• 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

init and destroy.

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are the System.out.println()(SOPs) statements not printed on my console when they are included in the init and destroy methods.?
If i write SOPs in my doGet and doPost , they get printed.?
Also , i would like toknow whether a servlet and can have acinstructor written? what would be the impact of this contructor on the servlet life cycle?
Thanx in advance,
Chhaya
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can have a constructor for servlet.There wud be no impact.The constructor wud be called once just like init() when servlet is loaded
 
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
System.out.println should print from your init and destroy methods - if not you may have a serious problem. The first thing I would suspect is that the method signatures are not correct. You better double-check by looking at the javax.servlet.GenericServlet JavaDocs.
Bill
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Silly question, but are they not being printed to your container log?
i.e. If using Tomcat then look in $TOMCAT_HOME/logs/catalina.out
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic