6 Replies Latest reply on Oct 16, 2003 1:43 PM by pmccarty

    how to keep java generated from JSP?

    pmccarty

      I would like to see the java code generated from a JSP. With Weblogic, there is the ability to specify that the intermediate java code is retained by setting a 'keepgenerated' property in the web.xml file, as follows:


      <servlet-name>jsp</servlet-name>
      <servlet-class>weblogic.servlet.JSPServlet</servlet-class>
      <init-param>
      <param-name>verbose</param-name>
      <param-value>true</param-value>
      </init-param>
      <init-param>
      <param-name>keepgenerated</param-name>
      <param-value>true</param-value>
      </init-param>
      ...


      Is there a means of keeping the generated java around when using JBoss? I am using JBoss 3.2.1, which uses Jetty as its server container.

      thanks,
      Perry

        • 1. Re: how to keep java generated from JSP?
          pmccarty

          As a followup: if there is a method for achieving this, where would I have found it in the documenation for JBoss (or Jetty)?

          thanks,
          Perry

          • 2. Re: how to keep java generated from JSP?

            Jetty generates the servlets code fromJSPs in /temp directory of yr machine, though u can configure it to genertae in Jboss environment.
            This is on linux, I presume same is the case on windows and others.
            I hope this info helps.
            Vishal

            • 3. Re: how to keep java generated from JSP?
              pmccarty

              Thanks, I found the generated files in the /tmp directory. I would like to be able to configure this but don't know how. The configuration example in my first posting is for WebLogic. Do you know where I would look to find out how to set the configuration information?

              I am using Linux (though I expect the configuration setup would be very similar on Windows).

              thanks,
              Perry

              • 4. Re: how to keep java generated from JSP?
                jonlee

                You can add to JAVA_OPTS in run.sh the following:
                -Djava.io.tmpdir=/jetty

                This will cause the compiled data and other files to be directed to the /jetty directory in this instance. Adjust it for your requirements. JBoss will still clean this directory up when you reboot JBoss.

                By default for Jasper, the Java file will be kept during the lifetime of the Jetty run-time instance. Look at server/default/deploy/jbossweb-jetty.sar/webdefault.xml and you will see the comments regarding keepgenerated. You could explictly set it by:
                <init-param>
                <param-name>keepgenerated</param-name>
                <param-value>true</param-value>
                </init-param>

                To keep the JSP compiled code between reboots, you would need to apply a jetty-web.xml (in the WEB-INF directory of your WAR):
                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">




                jsp

                scratchdir
                /tmp/TestFAU






                This places the scratchdirectory at /tmp/TestFAU and JBoss will not clean this up.

                Hope that answers the questions adequately.

                • 5. Re: how to keep java generated from JSP?

                  Jonlee, u are a genious mate.
                  This info is waht everyone would be looking for.


                  Vishal.

                  • 6. Re: how to keep java generated from JSP?
                    pmccarty

                    This is exactly what I was looking for! (I noticed that there was no documentation cited in which this info resides, but it was very helpful to point out that I should be reviewing what is in the run.sh file and the jbossweb-jetty archives). Your examples are excellent.

                    Thanks so much,
                    Perry