wood burning stoves 2.0*
The moose likes Servlets and the fly likes reaction of the container if we place init() in service() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "reaction of the container if we place init() in service()" Watch "reaction of the container if we place init() in service()" New topic
Author

reaction of the container if we place init() in service()

sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
hi

What will be the reaction of the container if we place
init(ServletConfig sc) in
service(HttpServletRequest req,HttpServletResponse res) throws ServletException,java.lang.IOException

thanks in advance
saiprasanna
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
That depends on what your init method does. In any case, the servlet container will call init after it has created an instance of your servlet and before any request is processed - as per the API.

Where do these bizarre questions about servlet methods come from? Is this some sort of on-going joke? Why don't people just read the tutorials and the API documentation? Admitedly, moving from a single-user desktop application environment to a container controlled environment is tricky, but it is all documented.

Bill
 
Consider Paul's rocket mass heater.
 
subject: reaction of the container if we place init() in service()