Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Servlet / Tomcat

Status
Not open for further replies.

andyberlin2000

Programmer
May 12, 2004
18
DE
Hi!
While developing jsp-classes I always can remove compiled files from the tomcat directory - they will be recompiled.

Then I tried servlets...
A new program version of a SERVLET (same name...) seems to require -
* stop TOMCAT
* restart TOMCAT
* use a new browser window
otherwise the old program version will be used until eternity. I could not find ANY direstories with temporary files to delete - do I really have to take ALL THREE steps every time I change a single program line in my Java code?

Thanks for any help...
Andy
 
In short, yes.

If your classes are contained within a war file, in theory you should be able to redeploy that war, and have the new classes updated, but in practice I have found that this does not always work.

The reason that JSP's are put into the /work directory as class files is becasue the jasper parser converts your JSP files in servlet classes. When a change in your JSP is detected, it is recompiled, and a new version is created of the class file. The tomcat ClassLoader unloads the old class and reloads the new one.
This whole palava is not needed for servlets because they are already compiled ...
 
After the first use Tomcat has loaded the servlet into memory so it doesn't refer to your class file until you've reset.

When developing, I find it easiest to keep a browser window open in the Tomcat Web Application Manager and click on reload to stop and start my session.

Jeremy Nicholson, System Architect
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top