Topic: web.xml配置问题

  Print this page

1.web.xml配置问题 Copy to clipboard
Posted by: 20502422
Posted on: 2005-06-07 18:55

最近发现了个很奇怪的问题,错误提示如下:
type Status report

message /ch8/session_test.jsp

description The requested resource (/ch8/session_test.jsp) is not available

可我可以肯定路径没错,session_test.jsp也确实在那个路径里面。只要把web.xml里面关于listener的项目删掉之后页面就可以正常打开,所以应该是web.xml的配置问题,请大虾们帮忙查看有何不妥及如何修改。谢谢!!

我的web.xml如下:
<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app 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 web-app_2_4.xsd"
version="2.4">

<display-name>Welcome to Tomcat</display-name>
<description>
JSP应用开发详解
</description>
<filter>
  <filter-name>encoding</filter-name>
  <filter-class>com.jspdev.ch8.EncodingFilter</filter-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>gb2312</param-value>
  </init-param>
</filter>
<filter>
<filter-name>auth</filter-name>
<filter-class>com.jspdev.ch8.SignonFilter</filter-class>
</filter>

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

<filter-mapping>
<filter-name>auth</filter-name>
<url-pattern>/security/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>auth</filter-name>
<url-pattern>/admin/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>com.jspdev.ch8.MyServletContextListener</listener-class>
</listener>
<listener>
<listener-class>com.jspdev.ch8.MySessionListener</listener-class>
</listener>
<listener>
<listener-class>com.jspdev.ch8.MyRequestListener</listener-class>
</listener>

</web-app>

2.Re:web.xml配置问题 [Re: 20502422] Copy to clipboard
Posted by: 20502422
Posted on: 2005-06-08 15:21

天啊,哪位懂xml帮忙看看吧,谢谢了。

3.Re:web.xml配置问题 [Re: 20502422] Copy to clipboard
Posted by: bluepure
Posted on: 2005-06-08 15:53

应该是你的listener写的有问题,在执行listener的时候向上层抛出了异常,
然后导致webapp没有成功部署。

而且很可能是MyServletContextListener里有错。

跟web.xml没有关系。

4.Re:web.xml配置问题 [Re: 20502422] Copy to clipboard
Posted by: 20502422
Posted on: 2005-06-08 17:25

谢谢,确实是MyRequestListener有错。非常感谢。查错中。。。。。。。。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923