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 public void init(ServletConfig) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "public void init(ServletConfig)" Watch "public void init(ServletConfig)" New topic
Author

public void init(ServletConfig)

Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Hi, I have a question about public void init(SrvletConfig). When is this method invoked? Is it invoked each time a request to the servlet is made?
Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12267
    
    1
The API guarantees that init will be called before any request is processed. It is the first method called after the servlet container creates a servlet object, and is only called once.
At the other end of the servlet object life-span we have the destroy() method which the servlet container calls before discarding your servlet object.
Bill

------------------
author of:


Java Resources at www.wbrogden.com
Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Thank you Bill.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: public void init(ServletConfig)
 
Similar Threads
what are the return values of init method in servlets
doubt in enthuwere mocktest question
init() about servlet life cycle ?
servlet questin
Which one gets first executed ?????????