我们知道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.
本文探讨了JSP的编译流程,指出.jsp文件会被编译成.java然后转为.class。这些生成的.java源码通常位于Jetty或Tomcat的工作目录下,如jetty/work或tomcat/work。对于JSP-2.1及以上版本,使用JDK6+时,默认不会保留源码,除非配置KeepGenerated参数。而在Tomcat中,此特性默认开启。
2039

被折叠的 条评论
为什么被折叠?



