• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tracking the JSP translation time  RSS feed

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
we know that JSP is converted to servlet at first time it is requested after it changes/created. Then the subsequent request is handled by the converted servlet clas file. practically how i can check or look at the time when it was Translated to the servlet, because once it get translated at the first request, the second time it get again translated will be based on whether that particular JSP file is changed or not. i want to track down time at which the JSP file get changed.

any one please
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly are you trying to do?

If you only want to track when a JSP gets changed, why not put it under a version control system such as Subversion.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing you could look at is the timestamp for either the generated servlet source files or for the compiled class files.
Where these are, of course, depends on your container.

In Tomcat, the generated servlet sources are under the TOMCAT_HOME/work directory.
 
Gareth Faulkner
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Track down the JSPs generated java files (stars underscore) on your server and check the system time when the file was created or last changed.

Gareth
 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i am sorry for not putting my question correctly...

Actually i need to display the last time the JSP file changed, this help me while debugging.

I am able to acheive this in servlet by putting the System.out... in the init() method since this is the one which is called every time the servlet get changed. i wanna to know how can i acheive this functionality in JSP too.
 
Gareth Faulkner
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you actually want to run some code from your init method, or do you just write a System.out with the current time to show its been changed?

If you just want the time, then as I mentioned above, just find the time the JSPs class file was created.

By the way, the init method of a Servlet (or JSP) will run the first time the Servlet is called after the server is restarted if the code in the Servlet has changed or not....

Gareth
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!