Tomcat找不到servlet

时间:2016-03-31 02:54:55

标签: tomcat servlets gwt deployment http-status-code-404

我目前正在开发部署到Tomcat 7的GWT程序,我的程序没有响应按钮点击。

稍微挖掘一下日志后,我似乎找到了问题所在。在我的访问日志中,我发现了这个:

[31/Mar/2016:02:27:19 +0000] "GET /test6/ HTTP/1.1" 404 963
[31/Mar/2016:02:27:38 +0000] "POST /LuceneServlet HTTP/1.1" 404 977
[31/Mar/2016:02:27:39 +0000] "POST /LuceneServlet HTTP/1.1" 404 977
[31/Mar/2016:02:27:40 +0000] "POST /LuceneServlet HTTP/1.1" 404 977
[31/Mar/2016:02:27:41 +0000] "POST /LuceneServlet HTTP/1.1" 404 977

所以看起来好像从未找到过servlet。 war文件是由eclipse和GWT编译器创建的。这是创建的web.xml。

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">

  <!-- Servlets -->
  <servlet>
    <servlet-name>PerformSearchImpl</servlet-name>
    <servlet-class>com.utm.csc.server.PerformSearchImpl</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>PerformSearchImpl</servlet-name>
    <url-pattern>/SearchTest/PerformSearch</url-pattern>
  </servlet-mapping>

  <!-- Default page to serve -->
  <welcome-file-list>
    <welcome-file>/LuceneServlet</welcome-file>
  </welcome-file-list>
 <!-- Servlets -->

  <servlet>
  <servlet-name>LuceneServlet</servlet-name>
  <servlet-class>
    com.utm.csc.server.LuceneServlet
  </servlet-class>
  </servlet>

  <servlet-mapping>
  <servlet-name>LuceneServlet</servlet-name>
  <url-pattern>/LuceneServlet</url-pattern>
</servlet-mapping>
</web-app>

它出了什么问题?编译好的LuceneServlet.class位于/ WEB-INF / classes / com / utm / csc / server /,是不是web.xml正确?

由于

0 个答案:

没有答案