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 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" Watch "JSP" New topic
Author

JSP

agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
As we know that JSP page is translated and compiled at first client request usually.Does this happen at every time when Container is started and a client requests the JSP?If not then how Container figures out whether there has been a change in it since last time?


<i>--Agrah Upadhyay--</i><br />Final Year B.Tech SCJP,SCWCD,SCBCD <br /> <br /><b>Now since the real test for any choice is having to make the same choice again,knowing full well what it might cost.</b>-Oracle
lalit upadheyay
Ranch Hand

Joined: Jun 20, 2005
Posts: 110
i guess, that the container figures out the source code changes though the timestamp comparison on source code and the compiled code (.class). The compiled code(.class) should have a higher timestamp than the source code( i.e. JSP file).

But this behaviour is not certainly implemented. And sometimes we have to mannually delete the source code (.java) and the compiled code (.class) to get the latest changes.


SCJP1.4, SCWCD1.4, SCBCD5.0(working on...)
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
Thank you very much but what is timestamp?
lalit upadheyay
Ranch Hand

Joined: Jun 20, 2005
Posts: 110
timestamp is the latest file modification time. which it compares both for the .JSP file and .class file corresponding it.
sriRam gaddaM
Greenhorn

Joined: Dec 17, 2004
Posts: 7
I think, If you change the code in JSP and next time you issue a request for execution,the JSP goes thru all the phases like translation, compilation and loading and instantiation of the servlet class generated by the JSP engine.
[ December 12, 2005: Message edited by: sriRam gaddaM ]
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
But SriRam don't you think it would be performance prone if we have say 1000 JSPs?
lalit upadheyay
Ranch Hand

Joined: Jun 20, 2005
Posts: 110
yes, the container should go through all the stages but it doesn't. I faced this problem yesterday evening when i changed a hardcoded request paramter in jsp file and forwarded it to another page to access there, but it reflected me old values even when i restarted tomcat. I was working on tomcat 5.0.19 on windows platform.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP
 
Similar Threads
Make and use bean in same jsp
ace
Compiling jsp to servlet-Concept
threadSafety.jsp SCWCD study kit example
Servlets Vs JSP