Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jspInit() or jsp_init()?

 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Adrian Pang
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could be wrong, but I always thought set B is correct and I never see set A before...
 
Osama Hasan
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Osama Hasan
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leena,

Can you share with us the resources which mentions these two sets?
 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya sure!

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

Regards,
Leena
 
Ritesh Agrawal
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic