4 Replies Latest reply on Jan 22, 2004 10:10 AM by RAPHEAD

    JSP Compiles again and again

    xoo Newbie

       

      "xoo" wrote:
      Hi,

      i deploy a web application in a war file.
      Every time i request a jsp page, jboss compiles it with javac. the problem ist, that the compile process takes nearly 10 seconds.
      Is there a possibility, that JBoss only compiles it one time ?

      thanks,

      xoo


        • 1. Re: JSP Compiles again and again
          Jon Barnett Master

           

          "jonlee" wrote:
          JSP compilation is not controlled by JBoss. JBoss only deploys files to the respective service, in this case either Tomcat or Jetty depending on your distribution bundle. Both servlet containers use Jasper. By default Jasper should only compile when the JSP changes (time stamp), or if it is packaged in a WAR file, when that WAR file time stamp changes. However, if you don't like the settings, you can modify them. The following example gives a production type setting - read the Jasper howto for greater detail.

          If Jetty, check server/instance/deploy/jbossweb-jetty.sar/webdefault.xml. There will be a Jasper configuration setting. Try configuring it like this:
          <servlet>
          <servlet-name>jsp</servlet-name>
          <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
          <init-param>
          <param-name>logVerbosityLevel</param-name>
          <param-value>WARNING</param-value>
          </init-param>
          <init-param>
          <param-name>development</param-name>
          <param-value>false</param-value>
          </init-param>
          <load-on-startup>3</load-on-startup>
          </servlet>

          This will also work for Tomcat. Check server/instance/deploy/jbossweb-tomcat.sar/web.xml.

          This applies for JBoss-3.2.x. Read the additional information on Jasper in these configuration files. You can also check the Tomcat website for more on Jasper 2 configuration. http://jakarta.apache.org/tomcat


          • 2. Re: JSP Compiles again and again
            kbreeze Newbie

             

            "kbreeze" wrote:
            We've had this problem before with a new server - the JSPs kept being re-compiled.

            The problem was that the server was setup with its system clock in a different timezone to the development PC. Tomcat kept thinking that the file had been updated because the date/time of the war file was older than the jsp files contained within it. Deploying the war file to the server was adjusting its file timestamp between the different time zones.





            • 3. Re: JSP Compiles again and again
              xoo Newbie

               

              "xoo" wrote:
              yeah yeah yeah, it works ... the problem was the time difference between deploy and develop ...

              thx for your answers ...

              xoo


              • 4. Re: JSP Compiles again and again
                RAPHEAD Newbie

                 

                "RAPHEAD" wrote:
                Worked for me too THANX!!!

                The time on the dev machine has to be behind the servers