唉!终于找到web.xml里面的错误了;前面一篇文章已写过。即http://blog.csdn.net/caoxu1987728/archive/2008/07/12/2645004.aspx。
不过当时就有错误,一直没检查出来,还以为是tomcat插件的原因,此时终于明白:tomcat插件于我只有好处,没有害处,不然要它干嘛,是不是啊
错误源码如下:
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app id="WebApp_ID" 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">
- <display-name>Search Engine</display-name>
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>
- /WEB-INF/classes/applicationContext.xml
- </param-value>
- </context-param>
- <filter>
- <filter-name>response-filter</filter-name>
- <filter-class>com.luceneheritrixbook.searchengine.filter.
- SetResponseFilter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>response-filter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <listener>
- <listener-class>
- org.springframework.web.context.ContextLoaderListener
- </listener-class>
- </listener>
- <servlet>
- <display-name>DWR Servlet</display-name>
- <servlet-name>dwr-invoker</servlet-name>
- <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
- <init-param>
- <param-name>debug</param-name>
- <param-value>true</param-value>
- </init-param>
- </servlet>
- <servlet>
- <servlet-name>showPic</servlet-name>
- <servlet-class>com.luceneheritrixbook.searchengine.servlet.
- ShowPicServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>dwr-invoker</servlet-name>
- <url-pattern>/dwr/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>showPic</servlet-name>
- <url-pattern>/showpic</url-pattern>
- </servlet-mapping>
- <session-config>
- <!-- Default to 5 minute session timeouts -->
- <session-timeout>5</session-timeout>
- </session-config>
- <welcome-file-list>
- <welcome-file>speclist.jsp</welcome-file>
- <welcome-file>index.htm</welcome-file>
- <welcome-file>index.jsp</welcome-file>
- <welcome-file>default.html</welcome-file>
- <welcome-file>default.htm</welcome-file>
- <welcome-file>default.jsp</welcome-file>
- </welcome-file-list>
- </web-app>
把
- <filter>
- <filter-name>response-filter</filter-name>
- <filter-class>com.luceneheritrixbook.searchengine.filter.
- SetResponseFilter</filter-class>
- </filter>
改为:
- <filter>
- <filter-name>response-filter</filter-name>
- <filter-class>com.luceneheritrixbook.searchengine.filter.SetResponseFilter</filter-class>
- </filter>
我靠,弄得我头疼这么长时间的问题简不简单?!!!!!
下面再查查filter到底何用……