码迷,mamicode.com
首页 > 编程语言 > 详细

SpringMvc xml 配置

时间:2015-12-10 23:34:35      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
	xmlns="http://java.sun.com/xml/ns/javaee" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
 <servlet>
 	<servlet-name>DispatcherServlet</servlet-name>
 	<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
 	<!-- 通知DispatcherServlet去指定的目录下加载springmvc.xml配置文件 -->
 	<!-- 在默认的情况下SpringMvc会去找/WEB-INF/<servlet-name>-servlet.xml -->
 	<init-param>
 		<param-name>contextConfigLocation</param-name>
 		<param-value>classpath:springmvc.xml</param-value>
 	</init-param>
 </servlet>
 <servlet-mapping>
 	<servlet-name>DispatcherServlet</servlet-name>
 	<url-pattern>*.action</url-pattern>
 </servlet-mapping>
 
 <!-- 注册Spring提供的处理Post请求的乱码问题 -->
 <filter>  
    <filter-name>CharacterEncodingFilter</filter-name>  
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>  
    <init-param>  
        <param-name>encoding</param-name>  
        <param-value>utf-8</param-value>  
    </init-param>  
</filter>  
<filter-mapping>  
    <filter-name>CharacterEncodingFilter</filter-name>  
    <url-pattern>/*</url-pattern>  
</filter-mapping>
</web-app>

  

SpringMvc xml 配置

标签:

原文地址:http://www.cnblogs.com/woolhc/p/5037388.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!