作者:冯婉婷562048 | 来源:互联网 | 2023-09-11 13:49
spring.xml文件
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
springMVC.xml文件
application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/springboot?useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=root
spring.mvc.view.prefix=/jsp/
spring.mvc.view.suffix=.jsp
logging.level.com.bw.dao=debugmybatis.mapper-locations=classpath:com/xinxin/mapper/*.xml
pom.xml
4.0.0com.xinxinxinxin0.0.1-SNAPSHOTwarshengchengqiDemo project for Spring Bootorg.springframework.bootspring-boot-starter-parent2.0.1.RELEASE UTF-8UTF-81.8org.springframework.bootspring-boot-starter-weborg.mybatis.spring.bootmybatis-spring-boot-starter1.3.2org.apache.tomcat.embedtomcat-embed-jasperprovidedjavax.servletjstlorg.springframework.bootspring-boot-devtoolsruntimemysqlmysql-connector-javaruntimeorg.springframework.bootspring-boot-starter-tomcatprovidedorg.springframework.bootspring-boot-starter-testtestcom.github.pagehelperpagehelper-spring-boot-starter1.2.3org.springframework.bootspring-boot-maven-plugin
web.xml
springmvc-01index.htmlindex.htmindex.jspdefault.htmldefault.htmdefault.jspcontextConfigLocationclasspath:spring-redis.xml,classpath:spring-mongo.xml org.springframework.web.context.ContextLoaderListenerspringmvcorg.springframework.web.servlet.DispatcherServletcontextConfigLocationclasspath:springmvc.xmlspringmvc*.actionmyfilterorg.springframework.web.filter.CharacterEncodingFilterencodingUTF-8forceEncodingtrue myfilter/*
mapper.xml
配置完就可以启动成功了!