• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

servletconfig and servletcntext  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the main purpose of these things in a servlet. I really dont understand.
Why should we overrite init(). does container dont call init()
 
Saloon Keeper
Posts: 4745
117
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

what is the main purpose of these things in a servlet. I really dont understand.


Give it a shot and try to explain to us what you did understand. The javadocs of ServletContext in particular go to some length explaining what it does. Ask yourself this: If you didn't have the methods in those classes, how would you go about doing the things they do?

Why should we overrite init(). does container dont call init()


You need to differentiate between Servlet.init(ServletConfig) and GenericServlet.init(). I suggest to read their respective javadocs; that should make things clearer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!