File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSP Compilation and Translation doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JSP Compilation and Translation doubt" Watch "JSP Compilation and Translation doubt" New topic
Author

JSP Compilation and Translation doubt

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Guys,

Can anyone please clearly mention what exactly happens during jsp translation and jsp compilation??


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Saurabh Kumar
Ranch Hand

Joined: Aug 21, 2006
Posts: 56
JSP Translation:
Containers don't directly process JSPs. They need JSP to be converted into a java class(servlet).
During translation, the container creates a java class, usually- "YourJspName_jsp.java".
The container writes _jspService() method for you.
Different jsp elements go to their respective places in this java class.

JSP compilation:
When container has created a java class for your JSP, it then compiles it to check the class for java syntax.
when this class compiles without error, it is now ready for use.

The container will instantiates as per the configuration details in your web.xml or when first request comes in for this JSP.

Hope this helps.

Thanks and regards,
Saurabh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
It will greatly aid your understanding of the process if you look at the Java source that is created for your JSPs. E.g., Tomcat keeps those in the TOMCAT_HOME/work/Catalina/localhost directory. Create various JSPs of differing complexity (with and without scriptlets, with and without using tags like JSTL, etc.), and check out what Java source is generated.


Ping & DNS - updated with new look and Ping home screen widget
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Thanks Saurabh and Ulf for the help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Compilation and Translation doubt
 
Similar Threads
Translation Phase of JSP - Doubt
JSP Translation
JSP Life.
jsp page translation
Transalation / Compilation