Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

difference between JSP pre translation and post transalation?  RSS feed

 
Sashidhar Rao Gopisetty
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
explain elobrately ?
[ September 26, 2005: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first time a JSP is hit a JSP compiler (called "Jasper" in the case of Tomcat and several other webservers) parses the JSP code and generates servlet code. The servlet code is then compiled into a Java class file and loaded into the JVM by the classloader.
All subsequent hits invoke this class and don't need to be re-compiled.

With Tomcat, you can see this generated code by looking in TOMCAT_HOME/work/Catalina/localhost/YOUR_WEBAPPS_NAME/org/apache/jsp.

I assume the terms pre and post translation are referring to the states before and after Jasper compile the JSP code into servlet code.

A good place to test your understanding of this process is in the decision to use the directive <%@ include file=".... or the JSP action <jsp:include..
The former merges the code into the generated servlet before it is compiled.
The latter results in both files being generated into separate servlets that each get excecuted at runtime. The output from each gets merged and sent to the browser.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!