1 <?XML version= "1.0" encoding= "UTF-8"?>2 <Web-appversion= "3.0" 3 xmlns= "Http://java.sun.com/xml/ns/javaee" 4 Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" 5 xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee6 http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd ">7 <Display-name>Archetype Created Web Application</Display-name>8 <welcome-file-list>9 <Welcome-file>/web-inf/pages/index.jsp</Welcome-file>Ten </welcome-file-list> One <!--Configuring monitoring Spring - A <Listener> - <Listener-class>Org.springframework.web.context.ContextLoaderListener</Listener-class> - </Listener> the <!--Specify the directory where the spring bean's configuration files are located - - <Context-param> - <Param-name>Contextconfiglocation</Param-name> - <Param-value>Classpath:applicationcontext-*.xml</Param-value> + </Context-param> - + <!--Configure spring character encoding to Utf-8 - A <Filter> at <Filter-name>Encodingfilter</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> in <Init-param> - <Param-name>Forceencoding</Param-name> to <Param-value>True</Param-value> + </Init-param> - </Filter> the <filter-mapping> * <Filter-name>Encodingfilter</Filter-name> $ <Url-pattern>/*</Url-pattern>Panax Notoginseng </filter-mapping> - the <!--configuration of the Springmvc - + <servlet> A <Servlet-name>Spring</Servlet-name> the <Servlet-class>Org.springframework.web.servlet.DispatcherServlet</Servlet-class> + <Init-param> - <Param-name>Contextconfiglocation</Param-name> $ <Param-value>Classpath:spring-servlet.xml</Param-value> $ </Init-param> - <Load-on-startup>1</Load-on-startup> - </servlet> the <servlet-mapping> - <Servlet-name>Spring</Servlet-name>Wuyi <Url-pattern>/</Url-pattern> the </servlet-mapping> - Wu - About <!--log4j Configuration - $ <Context-param> - <Param-name>Log4jconfiglocation</Param-name> - <Param-value>Classpath:log4j.properties</Param-value> - </Context-param> A <Context-param> + <Param-name>Webapprootkey</Param-name> the <Param-value>Slsalesystem.root</Param-value> - </Context-param> $ <!--Spring-loaded log4j monitoring - the <Listener> the <Listener-class>Org.springframework.web.util.Log4jConfigListener</Listener-class> the </Listener> the </Web-app>
SSM development about the Web. XML configuration