wood burning stoves
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "load-on-startup doubt ..." Watch "load-on-startup doubt ..." New topic

load-on-startup doubt ...

Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585

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

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();

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


SCWCD: Online Course, 50,000+ words and 200+ questions
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9999


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
I agree. Here's the link: http://aspose.com/file-tools
subject: load-on-startup doubt ...
jQuery in Action, 3rd edition