4 Replies Latest reply on Aug 25, 2003 8:03 AM by Jon Barnett

    Adding a context to Jetty to use jsp pages

    Jim Newbie

      How do I add an additional resource context to Jetty so .jsp files will be compiled?

      From my research, I need to add the proper handler to the following xml snipet:




      /documents/*
      /docroot









      What do I need to add so I can use JSP pages in the /docroot directory?

      Thanks

        • 1. Re: Adding a context to Jetty to use jsp pages
          Jon Barnett Master

          This is a solution. Since there are many things that must be statically defined, it is not flexible and may be subject to compilation and run-time failures. You would add the code fragment to your jbossweb-jetty.sar/META-INF/jboss-service.xml - probably after the listener definitions.


          /documents/*
          /docroot




          Java Server Page
          *.jsp
          org.apache.jasper.servlet.JspServlet
          /java/JBoss-3.2.0/server/default/lib/javax.servlet.jar:/java/JBoss-3.2.0/server/default/deploy/jbossweb-jetty.sar/jasper-runtime.jar









          It would be easier to just add a directory called documents.war to your deploy directory. You can then drop your JSPs and static content into the directory. Note that you do not need a WEB-INF/web.xml if you only have JSPs and static content.

          • 2. Re: Adding a context to Jetty to use jsp pages
            Archimedes Trajano Newbie

            Not really sure where to put this. This is the snippet I have before I started in the jboss-service.xml file inside jbossweb.sar\META-INF


            /Curam/*
            c:/Curam/webclient/Web Content/

            • 3. Re: Adding a context to Jetty to use jsp pages
              Archimedes Trajano Newbie

              I've got some partial good news on my part. I basically got JBoss to read the JSPs from a separate directory. However, it does not register the classpath properly nor the rest of the WEB-INFs :(

              I created a App.war folder which contained the entire contents of WEB-INF from my original app and a jetty-web.xml file which contained:

              <?xml version="1.0" encoding="ISO-8859-1"?>
              <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">

              C:/Curam/webclient/Web Content
              C:/Curam/webclient/Web Content


              I tried to set the "classPath" here, but it does not work. It requires the classpath from the WEB-INF

              • 4. Re: Adding a context to Jetty to use jsp pages
                Jon Barnett Master

                The Jetty tutorials specifically recommend that the JBoss classloader not be bypassed.

                "Note: If you run Jetty within JBoss, then you should NOT use the addWebApplication API (or XML), as this bypasses the JBoss classloaders. Use the JBoss deployment mechanisms instead and only use the Jetty configuration for listeners and logs."

                There are probably going to be a series of issues and consequences with creating a web application outside of the control of JBoss yet running in the JBoss environment.