3 Replies Latest reply on Jan 21, 2003 5:12 AM by Julian Gosnell

    Compiling JSPs at server starup

    Noel Rocher Apprentice

      Hi all,


      Is there a way to make all my JSPs to be compiled at jboss startup ?

      Cheers,


      Noel

        • 1. Re: Compiling JSPs at server starup
          Gabriel Reid Newbie

          > Is there a way to make all my JSPs to be compiled at
          > jboss startup ?

          We looked for a solution to this for a time, but were not able to find a really clean solution.

          What we ended up doing is making a page that contains frames that reference all compilable (non-included) JSPs with 'jsp_precompile' in the query string. When the server is started, we just have to access this one (password-protected) page and all JSPs get pre-compiled (assuming your JSP container supports the 'jsp_precompile' flag). Not the cleanest approach ever, but it does work.

          Something else that could be done to further automate this process would be to fork off a wget session or script of some sort (or something similar, depending on what is available on your platform) from in the JBoss startup script, so that the JSP precompilation would occur fully automatically.

          • 2. Re: Compiling JSPs at server starup
            Xavier Cho Newbie

            You can always use jspc to precompile jsp files when the servlet container is based on jasper engine. However, it could really slow down development process in some environment. Rather, if you use tomcat you can specify 'scratchdir' init parameter in your default web.xml file so jboss don't flush the compiled jsp files at redeploy or server restart.

            Hope this might help.

            Xavier

            • 3. Re: Compiling JSPs at server starup
              Julian Gosnell Expert

              I think there is something about this in the FAQ I just posted to this forum.

              IMHO, you should precompile your JSPs during yuor delivery cycle as a matter of course. Would you deliver Servlet code uncompiled ?

              Jules