aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Servlet Initialization Doubt ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Servlet Initialization Doubt ..." Watch "Servlet Initialization Doubt ..." New topic
Author

Servlet Initialization Doubt ...

Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Hi,

As i have understood from the HSFJ book, Servlet initialization is to instantiate the Servlet and call its init() method.

But in the The Java Server Pages (JSP) Technology Model mock exam of j2eecertificate, the following question :


Which of the following JSP page life-cycle phases occur before the container initialises a servlet instance? [Select all correct answers]

1call _jspService()
2load class
3create instance
4page translation
5call jspDestroy()



Is saying that answers 2, 3 and 4 are correct, but, from my understanding i have only chosen answers 2 and 4, which gave me a wrong answer

Please clear my doubts about Servlet initialization.

Thanks advance ...


Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi,

After the JSP page is translated to Servlet, it is compiled, an instance is
created and then initialization is done.

Thanks,


cmbhatt
Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Hi,

So by initialization it is meant the actual calling of the jspInit() method ha ? If yes, then i got the point.

I do know the life cycle of JSP very well, but that point was not clear.

Thanks in advance ...
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

Vassili, creation of instance is a seperate process and initializing an instance is a seperate process. Please note!


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
Dear Jothi,

I know that each action is a separate process, but in the the HFSJ book, page 403, there's somewhere that's saying :


initializes a servlet (instantiates the servlet the calls init() on the new object)


This was the thing that made me ask and have a doubt.

So please clear my doubt about the mock question, by initialization it is meaning the actual invocation of the init() method right ?

Thanks in advance ...
Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
So please clear my doubt about the mock question, by initialization it is meaning the actual invocation of the init() method right ?

Yes that's correct!

Regards,
Joshua


SCJP,SCWCD, Into ATG now!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

In servlets, initialization means running the init() method.
Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Thanks folks

Thanks alot

You guys have cleared my doubts

Best regards ...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Servlet Initialization Doubt ...