File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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: 12803
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reaction of the container if we place init() in service()