views:

183

answers:

2

Hi,

I am new to tomcat and servlets and am trying to deploy my first web application in tomcat and the index.jsp page is showing up blank.

It works fine in eclipse. I have the web.xml for the application setup to have the index.jsp as the default page. I am able to run the application and debug it in eclipse but when I export it as a WAR file and deploy it in tomcat and try to access it through a regular browser I get a blank page.

What am I missing here? Any help is greatly appreciated.

Thanks, - Vas

A: 

You need to configure your server.xml file and declare a context for your web application. You can find the documentation here: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

But a blank page is kind of weird, because I think if your web application wasn't deploy correctly, you will get a Http 404 error.

lepnio
Not needed, a default context is created for each webapp
Bozho
Thanks. Turns out it was an embarrassing spelling error in the URL. The weird part is I was expecting a log message in the tomcat logs saying that it was a bad URL but there is nothing. For example if my app is in example.com/A/ and I just simply type in example.com/ without the A should I be seeing an error or not?If so is there any additional configuration that could get that log?Thanks, - Vas
+2  A: 

If you ever get a blank page, the most important information you (and we) need are:

  1. The request URL.
  2. The already sent data -if any- (webbrowser > View Source).
  3. The response headers (Firebug? Webdeveloper Toolbar?).
  4. The server logs (stdout, stderr, webapp).

This usually indicate a wrong URL (to be proven by 1), or an exception halfway a JSP page (to be proven by 2 and 4), or an internal server error without an error page (to be proven by 3 and 4).

BalusC
Thanks. I will keep this in mind.