jsp生成的java在work目录下

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我们知道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 falsedefault true.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值