• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Compilation and Translation doubt

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Can anyone please clearly mention what exactly happens during jsp translation and jsp compilation??
 
Saurabh Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Saurabh and Ulf for the help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic