The title is pretty self-explanatory. When I run my app on Netbeans (Tomcat 7), everything works fine (the root index.jsp file from my dir structure is shown in the browser):

When I deploy the app to my production server, it deploys successfully:

however, when I try to access the page in the production server, it only shows me a blank page and not the index.jsp file:

Here is my web.xml file for this app:
<?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>
And my context.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path=""/>
The tomcat logs only show me successful requests (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 -
It turns out the problem was the filter class I had in the web.xml file. Initially i had put it in to take care of static file serving in Tomcat, but it seems like it confused Tomcat and no log showed the redirection or exceptions. It was working in Netbeans because Netbeans always deploys the app you are debugging in the ROOT folder. Unlike tomcat production servers, there are no context directories to account for, like in
where myapp is the context.
After changing the web.xml file and using the default servlet for the static files, I started using relative mappings — a bit hackish sometimes, but it works.
I had to change some urls in the project to account for the change. Since in a production server I have a context in the URLs, I had to change the URLs in CSS’s, for example, to use relative paths, like in ../static/img/myimage.jpg
This is the new version of the Web.xml file that is now working, for further reference: