您的位置:首页 > 编程语言 > Java开发

关于spring+springMVC+myBatis的一些基础配置以及整合

2016-01-27 14:19 701 查看
web.xml
 

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<!--
设置session过期的时间
-->
<session-config>
<session-timeout>20</session-timeout>
</session-config>

<!--
读取spring的配置文件
-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:config/spring.xml;classpath:config/spring-myBatis.xml</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>

<!--
设置字符编码,将所有的字符编码同意设置为utf-8
-->
<filter>
<filter-name>filterEncoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: