zoukankan      html  css  js  c++  java
  • web.xml模板

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee"
        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">
        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
        
    <!-- 配置springmvc, 将所有请求交给springmvc来处理 -->
    <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <!-- 配置springmvc核心配置文件的位置,默认Springmvc的配置文件是在WEB-INF目录下,默认的名字为springmvc-servlet.xml,如果要放在其他目录,则需要指定如下配置:
            -->
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/*.xml</param-value>
        </init-param>        
    </servlet>
    <!-- 其中的斜杠(/)表示拦截所有请求(除JSP以外), 所有请求都要经过springmvc前端控制器 -->
    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    
    <!-- 乱码处理过滤器 -->
    <filter>
        <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>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <!-- 指定拦截方式为拦截所有请求 -->
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    
    </web-app>
  • 相关阅读:
    ER图转关系模式, 强制参与和选择参与
    panoramio
    as3中flash的静态文本是可以直接访问的
    城市战3操作很失败
    20111120杭州天地行
    XNA 实用教程
    十、样式
    十三、“自己”的动画——图片转换
    十三、“导航”的动画——页面跳转
    十三、“自己”的动画——按钮
  • 原文地址:https://www.cnblogs.com/tsvv-plus/p/11911163.html
Copyright © 2011-2022 走看看