我们知道jsp的编译过程是jsp=>.java=>.class
这个.java文件在work目录下
比如 jetty/work
或者 tomcat/work
对于某些版本需要配置 KeepGenerated
http://docs.codehaus.org/display/JETTY/KeepGenerated
You set this initParam on the JspServlet in the webdefault.xml file:
<servletid="jsp">
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
...
<init-param>
<param-name>keepgenerated</param-name>
<param-value>true</param-value>
</init-param>
...
</servlet>
If you are using jsp-2.1, and you are using JDK6 or above, then the default behaviour of the jsp engine is to NOT keep the generated
java files around UNLESS you explicitly set it as above. If you are using JDK5, then the default IS to keep the generated java files.
Tomcat默认是开的
http://tomcat.apache.org/tomcat-7.0-doc/jasper-howto.html
keepgenerated - Should we keep the generated Java source code for each page instead of deleting it? true
or false
, default true
.