欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

web.xml的常见配置,webxml配置

来源: javaer 分享于  点击 4796 次 点评:245

web.xml的常见配置,webxml配置


web.xml的常见配置

<!-- 配置全局的编码过滤器 -->
  <filter>
  <description>编码过滤器</description>
  <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>
  <!-- 配置spring转发路劲 -->
  <servlet>
  <servlet-name>springmvc</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <init-param>
   <param-name>contextConfigLocation</param-name>
  <param-value>classpath:spring-*.xml</param-value> 
  </init-param>
  <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
  <servlet-name>springmvc</servlet-name>
  <url-pattern>/</url-pattern>
  </servlet-mapping>

  

相关文章

    暂无相关文章
相关栏目:

用户点评