Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Forcing JSP Recompile

 
Pam Doucette
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've run into a couple of instances when I've updated some java class files that will impact the jsps. However, the jsps themselves didn't need to be changed - and consequently were not re-compiled to show the impact of the other classes.
Is there a way to force a set of jsps to recompile besides deleting the class versions?
 
manav kher
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you restart your container..JRUN/Apache etc that should do it. Since an instance of the class is created when a JSP is first called, if the scope is set to be session closing all the browser windows and then re-logging (effectively starting a new session) will also acheive what you intend to.
-manav
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pam Doucette:
Is there a way to force a set of jsps to recompile besides deleting the class versions?

There's a wonderful little unix program called "touch" which will update the timestamp on a file. There are gazillions of ports to Windows. All you'd have to do is create a little batch file which executes "touch *.jsp" in your JSP directory.
- Peter
 
Dustin Marx
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too like "touch," but that approach does not work well with configuration management systems like Clearcase in which you would need to check-out each JSP as part of the batch file to "touch" it. So, in my case, I have found the easiest way to be to restart the web service, though sometimes I will also delete the entire classes directory to be certain the pages get recompiled.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic