站内搜索:
首页 >> 前端 >> 内容
struts2 2.5以上版本安装中web.xml的配置教程

时间:2017/11/30 14:37:18

struts2 2.5以上版本安装中web.xml的配置教程(包括核心过滤器filter)

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns="https://java.sun.com/xml/ns/javaee" xsi:schemaLocation="https://java.sun.com/xml/ns/javaee https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>zhongbao</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

 <filter>  
        <filter-name>struts2</filter-name> <!-- 过滤器的名字 -->  
        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> <!-- 引用个具体类文件 -->  
    </filter>  
    <filter-mapping>  
        <filter-name>struts2</filter-name>  
        <url-pattern>/*</url-pattern>  
    </filter-mapping>  

</web-app>

 

  • 上一篇:使用POST方法实现Django的表单(教程)
  • 下一篇:导致微信JSSDK自定义分享内容接口失效的原因分析
  • 返回顶部