开发者

Lifecycle, compilation and replacement of JSPs

开发者 https://www.devze.com 2023-02-05 12:19 出处:网络
I\'m having trouble to either find information about this as a whole and specifically about the placement of JSP code in tomcat.

I'm having trouble to either find information about this as a whole and specifically about the placement of JSP code in tomcat.

I have an application and develop for it. I' remotely debugging and changing code. This will not publish t开发者_运维技巧he code to the remote machine. So, I try to copy the JSP file over. This does not change a thing, when debugging, I can see that the debugger jumps on lines that contain no code.

Very well. I use Lambda Probe to delete the work directory and even explicitly recompile all JSPs, including the one I wanted to change in the first place. I can view the code and even the compiled servlet code, all listing my changes. However, running the debugger again and trying to debug my changed code STILL jumps to lines as if I didn't change my code at all.

This forces me to do a full deployment: I compile a whole WAR file, copy it to the server (it gets deployed), my program starts up, and I need about 10 minutes to get to the same point I was before.

Where the heck does tomcat cache/deposit the code of my JSPs beside the work directory? Is it at all possible to change code "on the fly" via the debugger? I know it's possible for classes as long as I do not change the method signature, but I am helplessly struggling with the same idea in JSP files.

Any help will be appreciated, be it links to explaining sites or explanations itself.

Thank you.


First of all you should automate your build, probably using ant. You need to be able to deploy quickly.

A vanilla tomcat will reload JSPs if it detects changes (usually from the file modification date). So make sure that the tomcat configuration does not prevent this happening. Have a look at http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html#Production_Configuration

To remove the compiled JSPs (thus forcing tomcat to recompile JSPs upon request) you can delete the appropriate folder under tomcat/work, e.g tomcat/work/Catalina/www.example.com/_/org under which you can find the compiled JSP and tag files.

0

精彩评论

暂无评论...
验证码 换一张
取 消