• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Life.

 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the following steps order is correct, do we have any more steps in the middle.

JSP page is compiled
JSP page is translated
JSP page implementation class is loaded
JSP page implementation class is instantiated
jspInit is called
_jspService is called
jspDestroy is called
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that by "translation" you mean the step of converting a JSP page into servlet source code, then that needs to happen before the compilation step.
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer for response.
Originally posted by Ulf Dittmer:
Assuming that by "translation" you mean the step of converting a JSP page into servlet source code, then that needs to happen before the compilation step.



asumption is correct, but without compiling JSP page , will it be translated into Servlet source.?
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope this helps from HFSJ

"The Container takes what you�ve written in your JSP, translates it
into a servlet class source (.java) file, then compiles that into a Java servlet class."

check with Chapter 7.
 
Shahnawaz Shakil
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chintu,
First JSP page is translated into servlet. During translation phase, the JSP engine reads a JSP page, parses it and validates the syntax of the tags used. For example following directive error will be caught during translation phase only:

After JSP page is translated into a servlet, this servlet is then compiled. In the compilation phase, the java file (that is the file generated in translation phase) is compiled using normal java compiler e.g javac. If you see the following declaration then this declaration will throw error during compilation because it is a valid JSP tag but an invalid java declaration statement.

Hope this will help
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much Shahnawaz Shakil,

So JSP life would be:
JSP page is translated
JSP page is compiled
JSP page implementation class is loaded
JSP page implementation class is instantiated
jspInit is called
_jspService is called
jspDestroy is called
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic