This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Compiling jsp to servlet-Concept Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Compiling jsp to servlet-Concept" Watch "Compiling jsp to servlet-Concept" New topic
Author

Compiling jsp to servlet-Concept

James Winfrey
Ranch Hand

Joined: Jan 04, 2009
Posts: 60
Hi Rancheers

I have a few doubts in the jsp compiling to servlet process.

when is the jsp translated into java servlet source code?
when is the java servlet source code compiled to java class?
when is the servlet first loaded, instantiated,initialized?

Thanks
James
Frits Walraven
Rancher

Joined: Apr 07, 2010
Posts: 1066

Hi James,

According to the JSP specifications: JSP.1.1.4

A JSP container manages two phases of a JSP page s lifecycle. In the translation
phase, the container validates the syntactic correctness of the JSP pages and tag
files and determines a JSP page implementation class that corresponds to the JSP
page. In the execution phase the container manages one or more instances of this
class in response to requests and other events.

and furthermore about the translation phase:

The translation of a JSP source page into its implementation class can occur at
any time between initial deployment of the JSP page into the JSP container and
the receipt and processing of a client request for the target JSP page.

When you define a JSP page in a servlet element with a load-on-startup element, it will be instantiated at the start of the application, otherwise the container decides

Does this answer your questions?
Regards,
Frits
James Winfrey
Ranch Hand

Joined: Jan 04, 2009
Posts: 60
Thanks a lot Frits.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Compiling jsp to servlet-Concept
 
Similar Threads
Difference in opening binary stream in jsp & servlet
Compler Errors
deployment environment can only have complied file?
JSP .class and .xml files generation
JSP - Compile errors because of includes