【struts2.5配置】web.xml配置

一、引用jar包

1. 将下载好的struts下的核心类库复制到/WEB-INF/lib目录下



二、web.xml配置

check your struts2-core-x.x.jar version.

-->if it is struts2-core-2.5.jar then change your filter class tag value in web.xml to

<filter-class>
     org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
  </filter-class>

-->if it is struts2-core-2.1.3.jar then change your filter class tag value in web.xml to

<filter-class>
     org.apache.struts2.dispatcher.FilterDispatcher
  </filter-class>

FilterDispatcher is deprecated since Struts 2.1.3. If you are working with older versions then user above solution.

-->if it is struts2-core-2.3.X.jar then change your filter class tag value in web.xml to

<filter-class>
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>

时间: 2024-08-24 17:25:25

【struts2.5配置】web.xml配置的相关文章

struts2拦截器-自定义拦截器,放行某些方法(web.xml配置)

一.web.xml配置 <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-val

web.xml 配置applicationContext.xml

web.xml中classpath:和classpath*:  有什么区别? classpath:只会到你的class路径中查找找文件; classpath*:不仅包含class路径,还包括jar文件中(class路径)进行查找. 有时候会用模糊匹配的方式配置多配置文件. 但是如果配置文件是在jar包里,模糊匹配就找不到了.可以用逗号隔开的方式配置多个配置文件. 如: <listener>  <listener-class>org.springframework.web.conte

struts2 实现过程和xml配置

实现过程: 当Web容器收到 请求(HttpServletRequest)它将请求传递给一个标准的的过滤链包括 (ActionContextCleanUp)过滤器,然后经过Other filters(SiteMesh ,etc),接下来需要调用FilterDispatcher核心控制器,然后它调用ActionMapper确定请求哪个Action,ActionMapper返回一个收集Action详细信息的ActionMaping对象. 接下来FilterDispatcher将控制权委派给Actio

SSH框架 web.xml配置

<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.s

Spring MVC的web.xml配置详解(转)

出处http://blog.csdn.net/u010796790 1.spring 框架解决字符串编码问题:过滤器 CharacterEncodingFilter(filter-name) 2.在web.xml配置监听器ContextLoaderListener(listener-class) ContextLoaderListener的作用就是启动Web容器时,自动装配ApplicationContext的配置信息.因为它实现了ServletContextListener这个接口,在web.

maven工程web层的web.xml配置文档内容

下面是web层,web.xml配置文档里面需要配置的东西: 1.lo4j配置 2.读取spring文件配置 3.设计路径变量值 4.spring字符集过滤器 5.登陆过滤器 6.springMVC核心配置 7.session过期时间 8.错误页面跳转 以下是实例: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSch

基于注解的Spring MVC(所需jar包,web.xml配置,Spring文件配置,@Controller,@RequestMapping,@RequestParam,model填參,EL取值)

1.加入jar 2.web.xml配置: <?xml version="1.0" encoding="UTF-8"? > <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocati

web.xml配置整理

虽然是做web开发,但是web中的很多配置有的时候却不是很清楚,只是知道怎么配置,于是就把在网上看到各种关于web.xml的东西整理一下: web.xml中url-pattern的3种写法 1完全匹配 <url-pattern>/test/list.do</url-pattern> 2 路径匹配 <url-pattern>/*</url-pattern> <!--匹配根路径下的全部请求--> 3扩展名匹配 <url-pattern>*

Web.xml配置详解(转)

Web.xml配置详解 Posted on 2010-09-02 14:09 chinaifne 阅读(295105) 评论(16) 编辑 收藏 1 定义头和根元素 部署描述符文件就像所有XML文件一样,必须以一个XML头开始.这个头声明可以使用的XML版本并给出文件的字符编码.DOCYTPE声明必须立即出现在此头之后.这个声明告诉服务器适用的servlet规范的版本(如2.2或2.3)并指定管理此文件其余部分内容的语法的DTD(Document Type Definition,文档类型定义).