标题是不言自明的。当我在 Netbeans (Tomcat 7) 上运行我的应用程序时,一切正常(我的 dir 结构中的根 index.jsp 文件显示在浏览器中):
当我将应用程序部署到我的生产服务器时,它会成功部署:
但是,当我尝试访问生产服务器中的页面时,它只显示一个空白页面,而不是 index.jsp 文件:
这是我的这个应用程序的 web.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">
<filter>
<filter-name>filter</filter-name>
<filter-class>com.dendro.mvc.filters.StaticFilesFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- abstract controller to filter static file requests -->
<servlet>
<servlet-name>Controller</servlet-name>
<servlet-class>com.dendro.mvc.filters.Controller</servlet-class>
</servlet>
<!-- servlet names -->
<servlet>
<servlet-name>PropagatedResults</servlet-name>
<servlet-class>com.dendro.query.PropagatedResultsServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>PlainResults</servlet-name>
<servlet-class>com.dendro.query.PlainResultsServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>HomeFilter</servlet-name>
<servlet-class>com.dendro.query.HomeFilterServlet</servlet-class>
</servlet>
<!-- mappings -->
<servlet-mapping>
<servlet-name>Controller</servlet-name>
<url-pattern>/views/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>HomeFilter</servlet-name>
<url-pattern>/views/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>PlainResults</servlet-name>
<url-pattern>/views/query/plain_results</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>PropagatedResults</servlet-name>
<url-pattern>/views/query/propagated_results</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
还有我的 context.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path=""/>
tomcat 日志只显示成功的请求(200 ok):
192.168.5.77 - - [23/Jun/2012:14:00:29 +0100] "GET /GraphQuery-1.0-SNAPSHOT/ HTTP/1.1" 200 -
192.168.5.77 - - [23/Jun/2012:14:00:29 +0100] "GET /GraphQuery-1.0-SNAPSHOT/ HTTP/1.1" 200 -
192.168.5.77 - - [23/Jun/2012:14:00:30 +0100] "GET /GraphQuery-1.0-SNAPSHOT/ HTTP/1.1" 200 -
192.168.5.77 - - [23/Jun/2012:14:00:31 +0100] "GET /GraphQuery-1.0-SNAPSHOT/ HTTP/1.1" 200 -