aspose file tools*
The moose likes Servlets and the fly likes blank page , no error, no output on running servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "blank page , no error, no output on running servlet" Watch "blank page , no error, no output on running servlet" New topic
Author

blank page , no error, no output on running servlet

Allen Bandela
Ranch Hand

Joined: Feb 16, 2006
Posts: 128

Hi everybody.

I've looked at the configuration again and again. The web.xml has a servlet mapping set up to the right class. I tested it by changing the servlet-class name, and it errored out. Likewise I changed the URL pattern and it errored out. When running the URL, all I get is a black page. No exception, no stack trace and strangely, the System.out statements I placed within init(config) and service(req,res) too aren't displaying. I also placed the System.out in a static block within the servlet but its not outputting those stmts. Could it be that the problem is within HttpServlet? I placed the System.out stmts before super.init(config) too. How should I debug it. Please help.

thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Without seeing your web.xml entry for this servlet and the URL with which you are calling it, it is not clear that you are really addressing the servlet correctly.

Once you are sure that the web.xml is indeed mapping to your servlet, the next step is always to ensure that init() is being called. I would not put any system out println before the super.init() call.

Bill
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

Check the log file if theres any exception.
Once a similar thing happened with me because of the corrupted servlet class file.


[Servlet tutorial] [Servlet 3.0 Cook Book]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The first thing I do when I see a blank page is right click on it and view the HTML source. Often the problem is an error in the HTML syntax.

Also, you aren't expecting System.out calls to be printed to the browser, are you?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Can you post the code to your servlet?
 
Don't get me started about those stupid light bulbs.
 
subject: blank page , no error, no output on running servlet