日期:2014-05-19  浏览次数:20613 次

大大们帮我看一下这段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.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
  <display-name></display-name>
  
<!--<filter>
        <filter-name>CharacterFilter</filter-name>
        <filter-class>com.csy.Filter.CharacterFilter</filter-class>
        <init-param>
            <param-name>ESCAPE_LIST</param-name>
            <param-value>/WEB-INF/escapelist.txt</param-value>
        </init-param>
    </filter>
  
<filter-mapping>
        <filter-name>CharacterFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>-->
  
  <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>GuestBook</servlet-name>
    <servlet-class>com.csy.controler.GuestBook</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>GuestBook</servlet-name>
    <url-pattern>/guestbook.do</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>
运行显示404错误,但是把filter那段注释掉后就没有问题了
xml filter

------解决方案--------------------
楼主的过滤器是什么意思?
------解决方案--------------------
最好贴出过滤器源码
------解决方案--------------------
<param-value>/WEB-INF/escapelist.txt</param-value>里面放的是编码集?指定一种就行了。
------解决方案--------------------
目测楼主
String[] tokens = input.split("="); 换成这样
且escapelist.txt
内容换成
<=&lt;
>=&gt;

给分