• 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

Small doubt on servlets class

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the relation between GenericSerlet and HttpServlet.

Is GenricServlet the super class for HttpServlet..

Question 2:

What is the role of initialization in Servlet life cycle. what actually it initializes.

Regards..
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is GenricServlet the super class for HttpServlet..

Yes; GenericServlet is a protocol-independent implementation of Servlet, basially providing storage of the ServletConfig and a new init() method for convenience. HttpServlet takes this one step further, and adds the convenient doXxx() methods. You can extend either (or implement Servlet directly) to create a servlet, but using HttpServlet as a base class is most common.

What is the role of initialization in Servlet life cycle. what actually it initializes.

Initialisation is a stage in the servlet's life invoked by the container. The servlet can use the initialisation stage to manage any start-up conditions, such as extracting initialisation parameters from the ServletConfig, or perhaps opening connections to persistent data stores (you must however be careful about multi-threading if you do this). It isn't that the servlet is initialising anything else, but rather that the servlet itself is being initialised.
 
reply
    Bookmark Topic Watch Topic
  • New Topic