Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Constructors.  RSS feed

 
Abhijeet Mahalkar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we have a constructor for Servlets ? Who manages the Object Creation in webserver. What are the role and responsibilities of Servlet Containers for Servlet Invocation. Actually i have one servlet class for which i have written my own constructor but i don't know how to handle this explicitly thru my own code rather than being dependant on container. Will anybody pls help me in this?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Web container invokes the servlet classes' constructors. Therefore you can only have the default constructor without arguments.
If you want to know about the responsibilities of the container and the servlet provider, please consult the specification.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!