SSM webXML文件模板


<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

  
  <filter>
    <filter-name>CharacterEncodingFilterfilter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilterfilter-class>

    <init-param>
      <param-name>encodingparam-name>
      <param-value>UTF-8param-value>
    init-param>
    <init-param>
      <param-name>forceEncodingparam-name>
      <param-value>trueparam-value>
    init-param>
  filter>

  <filter-mapping>
    <filter-name>CharacterEncodingFilterfilter-name>
    <url-pattern>/*url-pattern>
  filter-mapping>

  <filter>
    <filter-name>HiddenHttpMethodFilterfilter-name>
    <filter-class>org.springframework.web.filter.HiddenHttpMethodFilterfilter-class>
  filter>

  <filter-mapping>
    <filter-name>HiddenHttpMethodFilterfilter-name>
    <url-pattern>/*url-pattern>
  filter-mapping>

  
  <context-param>
    <param-name>contextConfigLocationparam-name>
    <param-value>classpath:config/spring/applicationContext.xmlparam-value>
  context-param>
  
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListenerlistener-class>
  listener>
  
  <context-param>
    <param-name>log4jConfigLocationparam-name>
    <param-value>classpath:config/log4j.propertiesparam-value>
  context-param>
  <listener>
    <listener-class>org.springframework.web.util.Log4jConfigListenerlistener-class>
  listener>

  
  <servlet>
    <servlet-name>DispatcherServletservlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServletservlet-class>

    <init-param>
      <param-name>contextConfigLocationparam-name>
      <param-value>classpath:config/springmvc/springmvc.xmlparam-value>
    init-param>

    <load-on-startup>1load-on-startup>
  servlet>

  <servlet-mapping>
    <servlet-name>DispatcherServletservlet-name>
    <url-pattern>/url-pattern>
  servlet-mapping>

  <error-page>
    <error-code>404error-code>
    <location>/WEB-INF/errors/404.jsplocation>
  error-page>

  <error-page>
    <error-code>500error-code>
    <location>/WEB-INF/errors/500.jsplocation>
  error-page>

  <welcome-file-list>
    <welcome-file>index.jspwelcome-file>
  welcome-file-list>

web-app>

你可能感兴趣的:(Java工具模板,web.xml,spring,ssm,java)