Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

jspInit() or jsp_init()?

 
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
 
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...
 
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.
 
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
 
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.
 
Forget Steve. Look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic