struts的问题

是这样的,我在struts2的web.xml文件里加上过滤器的代码的时候,tomcat启动项目,打开网页的时候连首页都打不开,会报The requested resource () is not available.。把过滤器的代码去掉又可以了。有人知道是什么吗?

[code="java"]
<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:chemaLocation="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">

struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>


index.jsp


你试试
[/code]

这个是我的版本,我用的正常
[code="java"]

<?xml version="1.0" encoding="UTF-8"?>
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.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>


index.jsp

[/code]

肯定是你web.xml配置有问题,或者是请求的地址有问题

复制也有可能粘错位置,发上来看看

filter-mapping改一下试试看

[code="xml"]
struts2
/*

[/code]

如果你以*.do必须是.do的请求才可以拦截,相应的表单

加我QQ:503229799

[code="xml"]*[/code]
去掉/,再试试看

加我QQ把代码给我看看

我5点半下班,不行就7点多吧,7点多我到家了。