7 Replies Latest reply on Jul 3, 2003 5:45 AM by chanc59

    using jikes to compile JSPs

    Howard Clark Newbie

      I would like to use Jikes as my jsp compiler. I think I had this working under JBoss 3.0.6 by adding the following init-parameter to the jsp servlet descriptor in webdefault.xml:

      <init-param>
      <param-name>jspCompilerPlugin</param-name>
      <param-value>org.apache.jasper.compiler.JikesJavaCompiler</param-value>
      </init-param>

      and setting the classpath appropriately, as per the comment in webdefault.xml. But I cannot find the class JikesJavaCompiler in the 3.2.1 distribution.

        • 1. Re: using jikes to compile JSPs
          Jon Barnett Master

          I'm not sure I caught your meaning.

          The Jasper compiler related classes reside in jasper-compiler.jar located either server/instance/default/jbossweb-jetty.sar or server/instance/default/jbossweb-tomcat.sar depending on your distribution.

          Do you mean that the JBoss instance cannot locate the class? If so, what is the error?

          • 2. Re: using jikes to compile JSPs
            Howard Clark Newbie

            I assume you meant to say "deploy" instead of "default" in your pathnames. In any case the class org.apache.jasper.compiler.JikesJavaCompiler is not in any jar under jbossweb-jetty.sar as far as I can tell.

            In 3.0.6 it was located in server\instance\deploy\jbossweb.sar\org.apache.jasper.jar. This file is not part of the 3.2.1 distribution. The 3.2.1 jar server\instance\deploy\jbossweb-jetty.sar\jasper-compiler.jar does not contain any jikes-related classes.

            As for errors, I don't see any, the container just seems to default to using javac.

            • 3. Re: using jikes to compile JSPs
              Jon Barnett Master

              Looks like it has somehow been munged in the 3.2.1 release. Jasper is a borrowed library copied into the Jetty build. Jasper has been packaged in jasper-compile.jar and jasper-runtime.jar since at least Tomcat 4.1.20, maybe earlier.

              I would either get Jasper directly from the Tomcat 4.1.24 release or from JBoss 3.2.0. You should be able to drop it in as a replacement for your existing libraries. I've just tested it and Jetty is operational with the complete Jasper libraries.

              • 4. Re: using jikes to compile JSPs
                Jon Barnett Master

                My bad. I confused myself looking at the multiple config files and the jars. Could have sworn the plugin was in there.

                Went through it again. The new Jasper uses Ant to perform the compilation. So the init-parm you need to set is the compiler for Ant. I had these in my Linux build but had a throwover line from an old Tomcat copy. The compiler plugin parameter is ignored.

                e.g.

                <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>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>


                • 5. Re: using jikes to compile JSPs
                  Howard Clark Newbie

                  Thanks, that helped.

                  I still have a problem on Windows because the windows version of Jikes doesn't support the -encoding option. Probably nothing to be done for that except switch to Linux, heh.

                  • 6. Re: using jikes to compile JSPs
                    Jon Barnett Master

                    Yes, you are right. Jikes is a no-go on Windows still. I don't think anyone is enthused enough to add the encoding support for Windows.

                    • 7. Re: using jikes to compile JSPs
                      chanc59 Newbie

                      For jikes with -encoding support, see:
                      oss.software.ibm.com/developerworks/opensource/jikes/faq/dev-win32.shtml