• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

blank page , no error, no output on running servlet

 
Ranch Hand
Posts: 128
MS IE Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the log file if theres any exception.
Once a similar thing happened with me because of the corrupted servlet class file.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post the code to your servlet?
 
In the renaissance, how big were the dinosaurs? Did you have tiny ads?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic