Discussions

Web tier: servlets, JSP, Web frameworks: Does Tomcat 5.5 recompile JSP?

  1. Does Tomcat 5.5 recompile JSP? (2 messages)

    Hi everybody.

    Today I have installed Tomcat 5.5.9 (I'm not a complete newbie: I have worked with Tomcat 4.1 and 5.0 with no problem).

    But now I do have a real problem. Tomcat does not recompile JSPs when I update them at the webapps\ROOT directory. Therefore, it always presents the same web page, even if the corresponding Jsp has been updated.

    Even if I shutdown and restart Tomcat, the Jsp is not recompiled. The only way to make Tomcat recompile a JSP is to delete the compiled files in work\Catalina\- directory.

    I have checked that this is not a browser cache problem. It is a Tomcat problem since the compiled files don't change even if you update JSPs and restart Tomcat.

    I have tried with the preconfigured version of Tomcat 5.5.4 located in http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Preconfigured-Tomcat and I get the same results.

    What am I doing wrong? Please help me. I'm desperate and I don't know what else to do.

    Thanks in advance,

    Vicent Palasi
  2. I did find some info on this and options, but nothing seems to work.

    I looked into this one day, and there are several options regarding the JSP compiler in ..\jakarta-tomcat-5.5.x\conf\web.xml, but none seem to have any effect. I even posed this question on Tomcat users mail list, but no help/answer. I first saw the problem in 5.5.7, then upgraded to 5.5.9, same problem.


      <!-- The JSP page compiler and execution servlet, which is the mechanism -->
      <!-- used by Tomcat to support JSP pages. Traditionally, this servlet -->
      <!-- is mapped to the URL pattern "*.jsp". This servlet supports the -->
      <!-- following initialization parameters (default values are in square -->
      <!-- brackets): -->
      <!-- -->
      <!-- 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] -->
      <!-- -->
      <!-- compiler Which compiler Ant should use to compile JSP -->
      <!-- pages. See the Ant documentation for more -->
      <!-- information. [javac] -->
      <!-- -->
      <!-- classdebuginfo Should the class file be compiled with -->
      <!-- debugging information? [true] -->
      <!-- -->
      <!-- classpath What class path should I use while compiling -->
      <!-- generated servlets? [Created dynamically -->
      <!-- based on the current web application] -->
      <!-- -->
      <!-- development Is Jasper used in development mode? If true, -->
      <!-- the frequency at which JSPs are checked for -->
      <!-- modification may be specified via the -->
      <!-- modificationTestInterval parameter. [true] -->
      <!-- -->
      <!-- enablePooling Determines whether tag handler pooling is -->
      <!-- enabled [true] -->
      <!-- -->
      <!-- fork Tell Ant to fork compiles of JSP pages so that -->
      <!-- a separate JVM is used for JSP page compiles -->
      <!-- from the one Tomcat is running in. [true] -->
      <!-- -->
      <!-- ieClassId The class-id value to be sent to Internet -->
      <!-- Explorer when using <jsp:plugin> tags. -->
      <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
      <!-- -->
      <!-- javaEncoding Java file encoding to use for generating java -->
      <!-- source files. [UTF8] -->
      <!-- -->
      <!-- keepgenerated Should we keep the generated Java source code -->
      <!-- for each page instead of deleting it? [true] -->
      <!-- -->
      <!-- mappedfile Should we generate static content with one -->
      <!-- print statement per input line, to ease -->
      <!-- debugging? [true] -->
      <!-- -->
      <!-- trimSpaces Should white spaces in template text between -->
      <!-- actions or directives be trimmed? [false] -->
      <!-- -->
      <!-- suppressSmap Should the generation of SMAP info for JSR45 -->
      <!-- debugging be suppressed? [false] -->
      <!-- -->
      <!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
      <!-- dumped to a file? [false] -->
      <!-- False if suppressSmap is true -->
      <!-- -->
      <!-- genStrAsCharArray Should text strings be generated as char -->
      <!-- arrays, to improve performance in some cases? -->
      <!-- [false] -->
      <!-- -->
      <!-- errorOnUseBeanInvalidClassAttribute -->
      <!-- Should Jasper issue an error when the value of -->
      <!-- the class attribute in an useBean action is -->
      <!-- not a valid bean class? [true] -->
      <!-- -->
      <!-- scratchdir What scratch directory should we use when -->
      <!-- compiling JSP pages? [default work directory -->
      <!-- for the current web application] -->
      <!-- -->
      <!-- xpoweredBy Determines whether X-Powered-By response -->
      <!-- header is added by generated servlet [false] -->
      <!-- -->
      <!-- If you wish to use Jikes to compile JSP pages: -->
      <!-- Please see the "Using Jikes" section of the Jasper-HowTo -->
      <!-- page in the Tomcat documentation. -->

        <servlet>
            <servlet-name>jsp</servlet-name>
            <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
            <init-param>
                <param-name>development</param-name>
                <param-value>true</param-value>
            </init-param>
            <init-param>
                <param-name>modificationTestInterval</param-name>
                <param-value>20</param-value>
            </init-param>
            <init-param>
                <param-name>fork</param-name>
                <param-value>true</param-value>
            </init-param>
            <init-param>
                <param-name>xpoweredBy</param-name>
                <param-value>false</param-value>
            </init-param>
    <init-param>
    <param-name>compiler</param-name>
    <param-value>modern</param-value>
    </init-param>
    <init-param>
    <param-name>compilerSourceVM</param-name>
    <param-value>1.5</param-value>
    </init-param>
    <init-param>
    <param-name>compilerTargetVM</param-name>
    <param-value>1.5</param-value>
    </init-param>
    <init-param>
    <param-name>verbose</param-name>
    <param-value>true</param-value>
    </init-param>
            <load-on-startup>3</load-on-startup>
        </servlet>
  3. Re: Does Tomcat 5.5 recompile JSP?[ Go to top ]

    I am having the same problem. I used the default settings for web.xml, in the conf directory, and it doens't reload my JSPs. I even tried explictly setting the development init-param to true, and no luck. The only difference between my current app and what I have done in the past is that in the past I deployed a war file. Now I am deploying directly to an application directory, without the war file. Any ideas?
    Hi everybody.

    Today I have installed Tomcat 5.5.9 (I'm not a complete newbie: I have worked with Tomcat 4.1 and 5.0 with no problem).

    But now I do have a real problem. Tomcat does not recompile JSPs when I update them at the webapps\ROOT directory. Therefore, it always presents the same web page, even if the corresponding Jsp has been updated.

    Even if I shutdown and restart Tomcat, the Jsp is not recompiled. The only way to make Tomcat recompile a JSP is to delete the compiled files in work\Catalina\- directory.

    I have checked that this is not a browser cache problem. It is a Tomcat problem since the compiled files don't change even if you update JSPs and restart Tomcat.

    I have tried with the preconfigured version of Tomcat 5.5.4 located in http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Preconfigured-Tomcat and I get the same results.

    What am I doing wrong? Please help me. I'm desperate and I don't know what else to do.

    Thanks in advance,

    Vicent Palasi