java - Jsp 编译不是用 jboss 即时进行的

标签 java jsp jboss compilation

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

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

提前致谢!

最佳答案

您需要修改 $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]             -->

关于java - Jsp 编译不是用 jboss 即时进行的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5786610/

相关文章:

java - 应该如何设计执行 CRUD 操作的 Bean 的单元测试?

java - 扫描仪在使用 next() 或 nextFoo() 后跳过 nextLine()?

javascript - 我应该在不同的 iFrame 上包含相同的库吗?

java - 如何将 Oracle JBoss 数据源定义为只读?

java - Jboss 托管服务器在部署之间停止

java - 在 Java 中添加到 ArrayList 中的元素?

java - java计算两个日期之间的时间差,考虑营业时间、停工和周末

java - 将公共(public)代码放到单独的jsp中

java - JSP 找不到我的 servlet,有时会出现错误 500,有时会出现错误 404

hibernate - 在 JBoss/WildFly 中注入(inject) EntityManager