jsp 编译不能与 jboss 一起动态进行

发布于 2024-11-03 02:32:06 字数 139 浏览 0 评论 0原文

可以在应用程序部署期间或jboss启动期间编译jsp吗?通常jsp是即时编译的,但如果编译之前完成会很方便...

我读到不可能再用jee6预编译jsp...这就是为什么jboss 6不提供库的原因。还有其他方法吗这样做?

提前致谢!

It is possible to compile jsp during the application deployment or during jboss startup? Usually jsp are compiled on the fly but it would be convenient if the compilation was done before...

I read it is not possible anymore to precompile jsp wit jee6... That's why libraries are not supplied with jboss 6. Is there another way to do that?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

苍风燃霜 2024-11-10 02:32:06

您需要修改 $server/deploy/jbossweb.sar/web.xml 并使 jsp servlet 包含一个肯定的检查值

   <servlet>
      <servlet-name>jsp</servlet-name>
      <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
      <init-param>
         <param-name>checkInterval</param-name>
         <param-value>1</param-value>
      </init-param>

请参阅标记上方的文档:

   <!--   checkInterval       If development is false and checkInterval is   -->
   <!--                       greater than zero, background compilations are -->
   <!--                       enabled. checkInterval is the time in seconds  -->
   <!--                       between checks to see if a JSP page needs to   -->
   <!--                       be recompiled. [0]                             -->
   <!--                                                                      -->
   <!--   modificationTestInterval                                           -->
   <!--                       Causes a JSP (and its dependent files) to not  -->
   <!--                       be checked for modification during the         -->
   <!--                       specified time interval (in seconds) from the  -->
   <!--                       last time the JSP was checked for              -->
   <!--                       modification. A value of 0 will cause the JSP  -->
   <!--                       to be checked on every access.                 -->
   <!--                       Used in development mode only. [4]             -->

You need to modify $server/deploy/jbossweb.sar/web.xml and have the jsp servlet include a positive check value

   <servlet>
      <servlet-name>jsp</servlet-name>
      <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
      <init-param>
         <param-name>checkInterval</param-name>
         <param-value>1</param-value>
      </init-param>

See the docs above the tag:

   <!--   checkInterval       If development is false and checkInterval is   -->
   <!--                       greater than zero, background compilations are -->
   <!--                       enabled. checkInterval is the time in seconds  -->
   <!--                       between checks to see if a JSP page needs to   -->
   <!--                       be recompiled. [0]                             -->
   <!--                                                                      -->
   <!--   modificationTestInterval                                           -->
   <!--                       Causes a JSP (and its dependent files) to not  -->
   <!--                       be checked for modification during the         -->
   <!--                       specified time interval (in seconds) from the  -->
   <!--                       last time the JSP was checked for              -->
   <!--                       modification. A value of 0 will cause the JSP  -->
   <!--                       to be checked on every access.                 -->
   <!--                       Used in development mode only. [4]             -->
仅此而已 2024-11-10 02:32:06

我在我的开发环境中遇到了类似的问题。感谢Heiko的回答,我尝试了另一种选择,在web.xml中设置development和modificationTestInterval,如下所示。

  <init-param>
     <param-name>development</param-name>
     <param-value>true</param-value>
  </init-param>
  <init-param>
     <param-name>modificationTestInterval</param-name>
     <param-value>0</param-value>
  </init-param>

现在我可以修改“$JBOSS_HOME\server\default\tmp\%random_crap%\war-1.0.war\WEB-INF\jsp”中的 JSP 并重新编译它,而无需重新启动 JBOSS。

另请注意,JBoss 4.3 中不需要此操作,因此对于从 4.3 升级到 5.2 的开发人员,只需注意此额外步骤即可。

I was facing similar issue in my development environment. Thanks to Heiko's answer, I tried another option by setting development and modificationTestInterval as follows in the web.xml.

  <init-param>
     <param-name>development</param-name>
     <param-value>true</param-value>
  </init-param>
  <init-param>
     <param-name>modificationTestInterval</param-name>
     <param-value>0</param-value>
  </init-param>

Now I'm able to modify the JSPs in '$JBOSS_HOME\server\default\tmp\%random_crap%\war-1.0.war\WEB-INF\jsp' and have it recompile without restarting JBOSS.

Also want to note this was not required in JBoss 4.3, so for developers upgrading from 4.3 to 5.2 just be aware of this extra step.

护你周全 2024-11-10 02:32:06

默认情况下,JBoss 的最新版本(如 EAP 6)预编译所有 JSP 并使用该编译版本,直到应用程序完全重新部署。

您可以使用“Keep-Generate”和“Check-Interval”参数来修改该行为,以便 JBoss 在 JSP 更新时重新编译它们。有关这些参数的详细说明,请访问:

https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/html/Administration_and_Configuration_Guide/chap-Web_Subsystem.html

问候,
贡萨洛

By default, last versions of JBoss like EAP 6 precompile all the JSP and use that coompiled version untill ther is a full redeployment of the aplication.

You can use 'Keep-Generated' and 'Check-Interval' parameters to modify that behaviour, so that JBoss recompile JSPs any time they are updated. You have a detail description of those parameters at:

https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/html/Administration_and_Configuration_Guide/chap-Web_Subsystem.html

Regards,
Gonzalo

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文