File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes load-on-startup doubt ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "load-on-startup doubt ..." Watch "load-on-startup doubt ..." New topic
Author

load-on-startup doubt ...

Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Hi,

When i use the <load-on-startup> tag in the DD, the Servlet is loaded at deploy time, this is ok with me. But, does the <load-on-startup> call the init method on that Servlet ?

Please clear my doubts ...

Thanks in advance ...


Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
You might like to try something like a servlet with code such as


public void init(){
ServletContext ctx = getServletContext();
ctx.log("initializing");
}

Then restart your container without requesting the servlet and see what is in the the log.

Marcus


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9468
    
    2

Yes,

Loading also initializes. It will take you to the point where in when your first request comes in, it starts with the service method.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Thank you
 
jQuery in Action, 2nd edition
 
subject: load-on-startup doubt ...