It can be done on a per web application basis for Jetty. Create a jetty-web.xml in the WEB-INF directory of your WAR.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
This places the compile results in /jetty/MyCompJspDir and effectively beyond the control of JBoss when it performs its shutdown clean up of temporary directories.
Hope that helps.
succeeded, thank you
How can the same be done when using Tomcat ??
Unfortunately, I have not seen a similar capability in Tomcat 4.x. You are able to achieve this in Jetty because there is a custom override setting provided by Jetty.
There are no Tomcat configurations that JBoss doesn't track that I have found. I've tried explicit CatalinaHome definitions but JBoss still wipes the generated Java and class files. Perhaps this will be/has been addressed in later JBoss versions.
I haven't experimented with defining the scratchdir for the Jasper definition in web.xml. This will probably have side-effects such as clashes with different contexts with the same JSP names in the application.
Someone else may have found a means of doing this. The other option is to precompile or to generate servlets from the JSPs and bundle the results into the web application.
Then the switch from Jetty to Tomcat really is a degrade of Jboss ....
This feature is really useful under development where the app is restartet quite often because of some servlet-changes.
Another change from Jetty to Tomcat I have noticed, is the way the dispatcher handles redirects to JSP's. This makes it neccesary to recode all servlets, and to have two seperate sets of applications to work on either Jetty or Tomcat...
(Jetty makes a relative referece from the requestes servlet while Tomcat makes reference to root..)
Why did Jboss change it's default web-container ???
One thing that can be done, is to delete the 'jsp' servlet from the default web.xml, and put one in every app that needs jsp's. Then set the scratch-dir for the servlet to a ocation out of Jboss' control.
You don't have to delete the default one either...
I have tested a bit more, and found one easier way..
In the WEB.XML for your app, you create a servlet like this :
and map it like this :
Note that you cannot name it JSP, since this servlet-name is already taken, but you can specify the same mapping, and this mapping will override the default one...