您的位置:首页 > 产品设计 > UI/UE

web程序无法访问:The requested resource () is not available.错误

2008-12-25 22:37 537 查看
昨天按照书本写的第一个web程序就不能看到结果,显示结果如下:

HTTP Status 404 -

type Status report

message

description The requested resource () is not available.

Apache Tomcat/5.5.27


经过删除多余文件发现,是web.xml文件错误,其中struts2过滤器的class路径写错了。导致访问不了该class文件。从而有The requested resource () is not available.的提示。

如下的xml是正确的,原来出错的是下面红色字体部分:
<?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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐