5 Replies Latest reply on Sep 24, 2003 3:29 AM by Jon Barnett

    use jikes to compile JSP in default web.xml

    michael lee Newbie

      Hi,
      I have installed jboss 3.0.6 with embedded Tomcat (4.1.12). Under tomcat-4.1.x/conf, there is an web.xml which (according to the comment in the file) is the default for all web-application. Is this file used in JBoss+Tomcat environment?

      I have modified this file to use jikes instead of javac for JSP compliation. It seems does not work.

      Should the modification applied to web.xml for the specific application?

      Regards,
      Michael

        • 1. Re: use jikes to compile JSP in default web.xml
          Jon Barnett Master

          The default web.xml for the embedded Tomcat should exist in the Tomcat SAR located in the JBoss deploy directory. This configuration applies to all web applications unless overridden by a WARs web.xml.

          The JSP servlet should look something like the following for the Jikes implementation:

          <servlet-name>jsp</servlet-name>
          <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
          <init-param>
          <param-name>development</param-name>
          <param-value>false</param-value>
          </init-param>
          <init-param>
          <param-name>checkInterval</param-name>
          <param-value>900</param-value>
          </init-param>
          <init-param>
          <param-name>compiler</param-name>
          <param-value>jikes</param-value>
          </init-param>
          <init-param>
          <param-name>javaEncoding</param-name>
          <param-value>iso-8859-1</param-value>
          </init-param>
          <load-on-startup>3</load-on-startup>


          YMMV for tuning and operational parameters. Read the Tomcat notes on configuring Jasper for more information and refer to the servlet specifications for standard servlet configuration parameters in web.xml.

          • 2. Re: use jikes to compile JSP in default web.xml
            michael lee Newbie

            Thanks for your reply.

            However, i am using 3.0.6. Is the Tomcat SAR you mention just exists in 3.2?

            Would you please specify the cooresponding name of the file in 3.0.6?

            Regards,
            Michael

            • 3. Re: use jikes to compile JSP in default web.xml
              Jon Barnett Master

              Sorry, my bad. The 3.0.x releases lacked consistency in this area of configuration and deployment. The web.xml will be in the separate Tomcat-4.1.x/conf directory. Modify that accordingly. At the least, add the Jikes parameter and the encoding for Jasper to run correctly.

              • 4. Re: use jikes to compile JSP in default web.xml
                michael lee Newbie

                Thanks. Actually, i have modified the web.xml to invoke jikes for JSP Compilation. Actually, my problem is that i am not sure whether jikes or javac has been used even after the modification. (since the message displayed is still [javac]).
                Yesterday, i have search the web on this issue and following is obtained.

                a simply way.
                >
                > don't set CATALINA_OPTS="-Dbuild.compiler.emacs=true"
                >
                > restart tomcat and request a jsp page with a syntax error like following
                >
                > BEGIN -----------------------
                > <% x = 10 %>
                > END ------------------------
                >
                >
                >
                > jikes produce this error:
                > org.apache.jasper.JasperException: Unable to compile class for JSP
                >
                > An error occurred at line: -1 in the jsp file: null
                >
                > Generated servlet error:
                > [javac] Compiling 1 source file
                >
                > [javac] Found 1 syntax error in
                >
                "/home/tfohrer/develop/Tomcat/4.1.17/jakarta-tomcat-4.0/dist/work/Standalon
                >e /localhost/_/jikes_jsp.java":
                >
                > [javac] 43. x = 0
                > [javac] ^---^
                > [javac] *** Syntax: ";" inserted to complete ExpressionStatement
                >
                >
                > javac produce this error:
                > Generated servlet error:
                > [javac] Compiling 1 source file
                >
                >
                /home/tfohrer/develop/Tomcat/4.1.17/jakarta-tomcat-4.0/dist/work/Standalone
                >/ localhost/_/jikes_jsp.java:43:
                > ';' expected
                > x = 0
                > ^
                >
                /home/tfohrer/develop/Tomcat/4.1.17/jakarta-tomcat-4.0/dist/work/Standalone
                >/ localhost/_/jikes_jsp.java:43:
                > cannot resolve symbol
                > symbol : variable x
                > location: class org.apache.jsp.jikes_jsp
                > x = 0
                > ^
                > 2 errors
                >

                I have performed the test and get the Jikes error message. Therefore, the web.xml i have modified is okay (just at the location you mentioned)

                Thanks again for your support.

                Regards,
                Michael

                • 5. Re: use jikes to compile JSP in default web.xml
                  Jon Barnett Master

                  Ah. I see that you were just trying to confirm Jikes invocation. You can also do that by removing the encoding definition as Jikes does invoke properly without it.