Spring MVC应用web.xml两种配置

2014-11-24 00:08:10 · 作者: · 浏览: 9

Spring MVC应用web.xml两种配置


环境:


Spring 3.2.8


JDK1.6


Tomcat6.x


1、亲测可用


< xml version="1.0" encoding="UTF-8" >



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">


Lrtech_framework



springMVC


org.springframework.web.servlet.DispatcherServlet



contextConfigLocation


classpath*:conf/springdemo-servlet.xml



1




springMVC


/




encodingFilter


org.springframework.web.filter.CharacterEncodingFilter



encoding


UTF-8




forceEncoding


true





encodingFilter


/*




2、亲测不可用,网上有人说可用。


< xml version="1.0" encoding="UTF-8" >



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">


springmvc app



contextConfigLocation


classpath*:conf/springdemo-servlet.xml




org.springframework.web.context.ContextLoaderListener




springMVC


org.springframework.web.servlet.DispatcherServlet



publishContext


false




publishEvents


false



1




springMVC


/




encodingFilter


org.springframework.web.filter.CharacterEncodingFilter



encoding


UTF-8




forceEncoding


true





encodingFilter


/*




启动后报错:


Spring MVC应用web.xml两种配置


相关阅读: