• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP lifecycle

 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
Can someone please explain JSP Lifecycle(interview question)...??
tia
MB
 
Vicky Nag
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typical life cycle for a JSP page:
A JSP before it is accessed for the first time exists as a .jsp file.
On the first request, it is translated to a .java file which is then compiled to a .class file for the servlet container to use.
From this point on, it enters the life cycle of a servlet
Hope this helps
V
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnx vicky
but when and how are the jspInit, jspService methods called and in what order.
tia
MB
 
Ron Perich
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Malhar Barai:
thnx vicky
but when and how are the jspInit, jspService methods called and in what order.
tia
MB

look at the Sun website...
JspPage
 
Simon Harvey
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the fairest thing to say on the issue of java vs php is that you may well like php for smaller sites. Short and seet work whose requirements won't really get that much more complicated down the line.
However, if you want a robust and extensible model, JSP is the best their is, not least of all because java is one of the easiest OO languages to learn (and having learned Java you essentially know C# as well!) and there is the whole power of the whole java arsenal behing you.
Peronally, if somethings worth doing and its important - do it in java.
Either way, good luck!
Simon
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ron Perich:

look at the Sun website...
JspPage

hi Ron
This only links me to the APIs, I want to know the complete lifcycle in the sense that wat is called first :
1. jspInit()
2. _jspService()...and so on...as I am not clear on wat method is called i.e is it _jspInit() or jspInit()...
tia
MB
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!