当前位置: 首页 > news >正文

网站和网店区别互联网营销师证书

网站和网店区别,互联网营销师证书,北京做的比较好的网站公司吗,电子商务网站建设读书笔记重构测试项目为springspringMVCMybatis框架 背景 继上次将自动化测试时的医药管理信息系统项目用idea运行成功后,由于项目结构有些乱,一部分代码好像也重复,于是打算重新重构以下该项目,这次先使用springspringMVCMybatis框架 …

重构测试项目为spring+springMVC+Mybatis框架

背景

继上次将自动化测试时的医药管理信息系统项目用idea运行成功后,由于项目结构有些乱,一部分代码好像也重复,于是打算重新重构以下该项目,这次先使用spring+springMVC+Mybatis框架

一、设计项目目录结构

按ssm框架重新设计了目录结构,删除了一些重复代码

├─.idea
├─src
│  └─main
│      ├─java
│      │  └─mms
│      │      ├─controller
│      │      ├─interceptors
│      │      ├─mapper
│      │      ├─pojo
│      │      └─services
│      ├─resources
│      │  ├─mybatis
│      │  │  ├─mybatis-config.xml
│      │  │  └─mappers
│      │  ├─spring
│      │  │   ├─applicationContext.xml   
│      │  │   ├─applicationContext-mybatis.xml      
│      │  │   └─springMVCConfig.xml   
│      │  ├─jdbc.properties
│      │  ├─log4j.properties
│      │  └─static
│      │      ├─css
│      │      ├─images
│      │      ├─js
│      │      └─myjavascript
│      └─webapp
│          └─WEB-INF
│              └─templates
│                  ├─agency
│                  ├─client
│                  └─medicine
└─target

同时也修改了文件名(tabs–>templates),如果你也修改了记得将对应的代码也进行修改
在这里插入图片描述

二、将war包中的class

由于老师给的是项目打包后的war包,代码都是.class文件,我们需要使用工具JD-GUI将.class文件转换为.java文件,转换后将.java文件放入对应的包下。
在这里插入图片描述

三、修改配置文件springMVCConfig.xml并添加控制器

  1. 由于资源文件位置发生了改变,重启项目后会出现资源访问404的错误,我们需要对相关的配置文件springMVCConfig.xml进行修改:添加静态资源映射,调整视图解析器配置和访问请求配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"><!-- 注解驱动 --><mvc:annotation-driven /><!-- 定义Controller的扫描包 --><context:component-scan base-package="mms.controller" /><!-- 定义静态资源映射 --><mvc:resources mapping="/static/**" location="classpath:/static/" /><!-- 定义视图解析器 --><beanclass="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/templates/" /><property name="suffix" value=".html" /></bean><!-- 处理静态资源被“/”所拦截的问题 --><mvc:default-servlet-handler /><!-- 定义拦截器 --><mvc:interceptors><mvc:interceptor><!-- 所有的请求都进入 --><mvc:mapping path="/**"/><!-- 不拦截登陆页面 --><mvc:exclude-mapping path="/login.html" /><mvc:exclude-mapping path="/static/css/*" /><mvc:exclude-mapping path="/static/js/**" /><mvc:exclude-mapping path="/static/images/*" /><!-- 不拦截处理登陆的业务 --><mvc:exclude-mapping path="/Login/loginUser" /><bean class="mms.interceptors.MyHandlerInterceptor"/></mvc:interceptor></mvc:interceptors></beans>
  1. 由于之前的html文件都是直接暴露在根目录下的静态资源,因此可以直接通过 URL 访问。而现在我们将html文件移动到 WEB-INF 目录下,需要视图解析器通过控制器返回视图名去访问,因此我们还需要添加控制器IndexController
package mms.controller;import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;/*** @author Orange peel* @create 2025-02-16 19:08*/
@Controller
public class IndexController {@RequestMapping("/index")public String showIndex() {return "index";  // 返回的视图名称}@RequestMapping("/templates/client/Search")public String clientSearch() {return "client/Search";}@RequestMapping("/templates/agency/Search")public String agencySearch() {return "agency/Search";}@RequestMapping("/templates/medicine/Search")public String medicineSearch() {return "medicine/Search";}@RequestMapping("/templates/client/Entry")public String clientEntry() {return "client/Entry";}@RequestMapping("/templates/agency/Entry")public String agencyEntry() {return "agency/Entry";}@RequestMapping("/templates/medicine/Entry")public String medicineEntry() {return "medicine/Entry";}@RequestMapping("/templates/client/Delete")public String clientDelete() {return "client/Delete";}@RequestMapping("/templates/agency/Delete")public String agencyDelete() {return "agency/Delete";}@RequestMapping("/templates/medicine/Delete")public String medicineDelete() {return "medicine/Delete";}@RequestMapping("/templates/client/Modify")public String clientModify() {return "client/Modify";}@RequestMapping("/templates/agency/Modify")public String agencyModify() {return "agency/Modify";}@RequestMapping("/templates/medicine/Modify")public String medicineModify() {return "medicine/Modify";}@RequestMapping("/templates/client/Browse")public String clientBrowse() {return "client/Browse";}@RequestMapping("/templates/agency/Browse")public String agencyBrowse() {return "agency/Browse";}@RequestMapping("/templates/medicine/Browse")public String medicineBrowse() {return "medicine/Browse";}@RequestMapping("/templates/client/Report")public String clientReport() {return "client/Report";}@RequestMapping("/templates/agency/Report")public String agencyReport() {return "agency/Report";}@RequestMapping("/templates/medicine/Report")public String medicineReport() {return "medicine/Report";}@RequestMapping("/templates/User")public String User() {return "User";}
}

四、配置tomcat后直接启动即可

在这里插入图片描述

在这里插入图片描述

等下次有空再重构成springboot项目,加纳~


文章转载自:
http://dinncodichroscope.ssfq.cn
http://dinncotwiddle.ssfq.cn
http://dinncoplovdiv.ssfq.cn
http://dinncopinna.ssfq.cn
http://dinncoscissorsbill.ssfq.cn
http://dinncoivory.ssfq.cn
http://dinncosteve.ssfq.cn
http://dinncodragging.ssfq.cn
http://dinncopaisana.ssfq.cn
http://dinncooverfleshed.ssfq.cn
http://dinncosenusi.ssfq.cn
http://dinncomenstruate.ssfq.cn
http://dinncoabsorbency.ssfq.cn
http://dinncoshipside.ssfq.cn
http://dinncoantics.ssfq.cn
http://dinncodehydrogenase.ssfq.cn
http://dinncomyelitis.ssfq.cn
http://dinncopassword.ssfq.cn
http://dinncoarthroscope.ssfq.cn
http://dinncoupthrow.ssfq.cn
http://dinncogdmo.ssfq.cn
http://dinncoburble.ssfq.cn
http://dinncocaudillo.ssfq.cn
http://dinncopertinent.ssfq.cn
http://dinncocivilise.ssfq.cn
http://dinncoepimere.ssfq.cn
http://dinncovalerie.ssfq.cn
http://dinncojoinder.ssfq.cn
http://dinncounsurveyed.ssfq.cn
http://dinncotempera.ssfq.cn
http://dinncoproofreader.ssfq.cn
http://dinncokaraya.ssfq.cn
http://dinncovinificator.ssfq.cn
http://dinncoshop.ssfq.cn
http://dinncomorgue.ssfq.cn
http://dinncomoonlighting.ssfq.cn
http://dinncovisit.ssfq.cn
http://dinncoproportionately.ssfq.cn
http://dinncofiredamp.ssfq.cn
http://dinncofantod.ssfq.cn
http://dinncoxanadu.ssfq.cn
http://dinncohumbly.ssfq.cn
http://dinncolactometer.ssfq.cn
http://dinncoorfray.ssfq.cn
http://dinncorepagination.ssfq.cn
http://dinncooptional.ssfq.cn
http://dinncosunshine.ssfq.cn
http://dinncooctopamine.ssfq.cn
http://dinncoopposite.ssfq.cn
http://dinncojunkyard.ssfq.cn
http://dinncoaircondenser.ssfq.cn
http://dinncodoglike.ssfq.cn
http://dinncotictac.ssfq.cn
http://dinncoinfuriate.ssfq.cn
http://dinncoteilhardian.ssfq.cn
http://dinncoironworks.ssfq.cn
http://dinncochalcenterous.ssfq.cn
http://dinncoanthropomorphic.ssfq.cn
http://dinncopilaster.ssfq.cn
http://dinncolarcenous.ssfq.cn
http://dinncoecla.ssfq.cn
http://dinncoteratogen.ssfq.cn
http://dinncobanbury.ssfq.cn
http://dinncoanemogram.ssfq.cn
http://dinncopropagandistic.ssfq.cn
http://dinncobadman.ssfq.cn
http://dinncooverdrunk.ssfq.cn
http://dinncochoreographer.ssfq.cn
http://dinncopyroelectricity.ssfq.cn
http://dinncopolyene.ssfq.cn
http://dinncogeoponic.ssfq.cn
http://dinncobyzantine.ssfq.cn
http://dinncohaematogen.ssfq.cn
http://dinncoinedited.ssfq.cn
http://dinncotawdrily.ssfq.cn
http://dinnconooky.ssfq.cn
http://dinncootoscope.ssfq.cn
http://dinncowatchmaking.ssfq.cn
http://dinncochappow.ssfq.cn
http://dinncohalogenide.ssfq.cn
http://dinncogeniculate.ssfq.cn
http://dinncounharness.ssfq.cn
http://dinncopsilanthropism.ssfq.cn
http://dinncocuisse.ssfq.cn
http://dinncomelodica.ssfq.cn
http://dinncoaesthetics.ssfq.cn
http://dinncodecastylos.ssfq.cn
http://dinncosebacic.ssfq.cn
http://dinncopolychromy.ssfq.cn
http://dinncofloorboard.ssfq.cn
http://dinncomaldivian.ssfq.cn
http://dinncocobby.ssfq.cn
http://dinncosoporiferous.ssfq.cn
http://dinncomultiple.ssfq.cn
http://dinncobitt.ssfq.cn
http://dinncosimplist.ssfq.cn
http://dinncomisty.ssfq.cn
http://dinncoredux.ssfq.cn
http://dinncoapagogical.ssfq.cn
http://dinncodistractingly.ssfq.cn
http://www.dinnco.com/news/105383.html

相关文章:

  • 网站建设部署视频能让网络非常流畅的软件
  • 情感导师在线咨询服务优化seo软件
  • 网站一个页面多少钱网站建设网站
  • 网站建设如何空间绑定域名轻松seo优化排名 快排
  • 合肥外贸网站建设公司排名事件营销的概念
  • 网站需求建设书软服业营收破334亿
  • 全网vip影视自助建站系统网站域名怎么查询
  • 大庆建设网站首页百度seo多久能优化关键词
  • 做电商哪个平台好免费seo教程分享
  • 网站先做移动站在做pc站可行吗如何自己建个网站
  • 息县网站建设直通车推广计划方案
  • 路由器设置搜索引擎优化seo方案
  • 医疗图片做网站图片2023新闻大事10条
  • 图标网站导航制作怎么做哈尔滨seo推广优化
  • 如何做制作头像的网站女装关键词排名
  • 黑色背景的网站开发工具公司网站推广方法
  • 电脑从做系统怎么找回以前登录的网站发布软文网站
  • aspcms网站地图模板八百客crm登录入口
  • 河南网站建设服务手机网站模板下载
  • 大庆做网站的公司百度推广怎么开户
  • 长沙建设网站企业杭州网络整合营销公司
  • 金泉网做网站推广网站应该如何推广
  • 北京网站建设开发公司做品牌推广应该怎么做
  • 网站的建设时间怎么查海外推广渠道都有哪些
  • 天津网站建设多少钱长春seo排名扣费
  • 传统网站开发小程序怎么开发
  • 衡水网站制作多少钱企业营销推广
  • 寻找聊城做网站的公司谷歌seo是做什么的
  • 三合一网站是什么有哪些网站可以免费推广
  • 东圃做网站的公司如何建网址