当前位置: 代码迷 >> Java Web开发 >> struts2 的过滤器解决思路
  详细解决方案

struts2 的过滤器解决思路

热度:121   发布时间:2016-04-17 11:01:23.0
struts2 的过滤器
小弟刚开始学习struts2
在写第一个程序时,在启动tomcat6.x时,报错,信息如下:
严重: Error filterStart
2009-4-30 17:39:39 org.apache.catalina.core.StandardContext start
严重: Context [/struts2] startup failed due to previous errors
2009-4-30 17:39:40 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080[/color]

WEB.XML配置文件如下:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

朋友们帮我看下,很是郁闷呐。谢谢!
网上的解释我去试过了,好像不是Struts2的大小写问题

------解决方案--------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

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

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
这是我项目中用到的,你看看。。。

如果还不好用,那就是struts2包导入的问题

  相关解决方案