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 Doubt of init method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Doubt of init method" Watch "Doubt of init method" New topic
Author

Doubt of init method

Abhay Choubey
Ranch Hand

Joined: Jun 02, 2011
Posts: 34
Hi All,

when a init() method call when client send a request or as apache tomcat server will start.

Thanks in advance
Abhay
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

First, init method is a call back method of a server. so, you dont have control on it. but in most of the container, you can ask server to start init method by requesting a servlet or at the time of starting a web application using load-on-startup tag .
Abhay Choubey
Ranch Hand

Joined: Jun 02, 2011
Posts: 34
calling the init method depends on the server and its configuration. it can be when -
server start or server get the first request. It is right

thanks in advance
Abhay
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

right!
Abhay Choubey
Ranch Hand

Joined: Jun 02, 2011
Posts: 34
Thanks a lot
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Abhay Choubey wrote:Thanks a lot

You are welcome
Sergey Baranov
Greenhorn

Joined: Aug 27, 2005
Posts: 18

According to specification:

Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
The servlet container calls the init method exactly once after instantiating the servlet. The init method must complete successfully before the servlet can receive any requests.


Sergey Baranov
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt of init method