aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jspInit() or jsp_init()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jspInit() or jsp_init()?" Watch "jspInit() or jsp_init()?" New topic
Author

jspInit() or jsp_init()?

Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
Hi Friends,

In the materials and tutorials Im reading, the life-cycle methods of the JSP are mentioned like

Set A:
jsp_init()
_jspService()
jsp_destroy()

Set B:
jspInit()
_jspService()
jspDestroy()

This made me confused. I checked the API documentation to find -

void jspDestroy()
jsp_destroy() is invoked when the JspPage is about to be destroyed.

void jspInit()
jsp_init() is invoked when the JspPage is initialized.

This was even more confusing!

1. Does jspInit() call jsp_init() internally?
2. Or it is a documentation mistake?

Anyone knows what is the right answer to be selelcted for JSP lifecycle methods?

Regards,
Leena


[SCJP2, SCWCD1.3, SCBCD]
Adrian Pang
Ranch Hand

Joined: Feb 20, 2004
Posts: 40
I could be wrong, but I always thought set B is correct and I never see set A before...


SCJP 1.4, SCWCD 1.4, SCBCD 1.3
Osama Hasan
Ranch Hand

Joined: Sep 30, 2002
Posts: 53
I also think set B is correct.i checked the API documentation and found this:
jspDestroy()
The jspDestroy() method is invoked when the JSP page is about to be destroyed.
jspInit()
The jspInit() method is invoked when the JSP page is initialized.


SCJP 1.4<br />SCWCD 1.4
Osama Hasan
Ranch Hand

Joined: Sep 30, 2002
Posts: 53
i also think that set B is correct.I found this in the API documentation:
jspDestroy()
The jspDestroy() method is invoked when the JSP page is about to be destroyed.
jspInit()
The jspInit() method is invoked when the JSP page is initialized.
Sivasundaram Umapathy
Ranch Hand

Joined: Aug 10, 2002
Posts: 360
Leena,

Can you share with us the resources which mentions these two sets?


Siva
Co-Author - SCMAD Exam Guide - ISBN:9780070077881
Author - Java certification success, Part 4: SCEA
Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
ya sure!

I referred to online API
http://java.sun.com/products/servlet/2.2/javadoc/

Regards,
Leena
Ritesh Agrawal
Ranch Hand

Joined: Jan 08, 2004
Posts: 74
Hi Leena,

Of course the link that you have provided does mentions method jsp_init() and jsp_destroy() methods. I verified the same information at other API documentation sources and found that they don't mention this. Please have a look at following URL

http://java.sun.com/j2ee/1.4/docs/api/index.html

So I believe that it must be a typo error. The set B is supposed to be the correct one.

Hope it helps.


Ritesh<br /> <br />SCJP 1.4<br />IBM Test 340<br />IBM AIX V4.0 Certified Professional<br /> <br />Right actions for the future are the best apologies for wrong ones in the past.<br />- Tyron Edwards
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jspInit() or jsp_init()?