3 Replies Latest reply on Jan 27, 2003 6:34 PM by nznl

    serving jsps and classes from multiple locations with Jetty

    nznl

      I'm using jboss 3.0.4 and the bundled jetty server.

      I am converting from using Resin as our servlet container. I can make wars work in live deployment but I'm stuck getting the development config set up.

      We have a webapp that, in development, uses jsps and classes from more than one location in our cvs repository. Thus I'm faced with two questions.

      1/ How do I specific more than one ResourceBase for the context I add in the jboss-service.xml so that I can serve jsps, images, and other files as required.

      2/ How do I make classes and jars from different locations available to my context?

      Has anyone made this work. I've tried creating an expanded war dir in the deploy dir but because I'm using win2k, I cannot do this with links like I would in unix.

      Any suggestions?

        • 1. Re: serving jsps and classes from multiple locations with Je
          nznl

          One more comment to add for clarity. In Resin, you can add multiple classpath entries for a webapp so this is what I'm looking for with Jetty.

          I tried setting the CLASSPATH for jboss but it seemed to screw up the classloader heirarchy and my servlets couldn't find HttpServlet. Is there a way to add classpaths to a webapp context for Jetty.

          On the jsp/static files front, I'm pretty sure I can create a simple dev servlet to serve these files from a location I specify. I'm not sure about the Jetty JspServlet though - how does it know where to look for jsps? I wonder if I could subclass it to get it to load from a location I control.

          Any other suggestions will be greatly appreciated.

          Steve

          • 2. Re: serving jsps and classes from multiple locations with Je


            1. I haven't tried it but using the classpath attribute in your war's MANIFEST.MF ?should? work.

            2. Find the mailing list URL in this FAQ and search the archive - there have been 2 or 3 threads on this recently...


            http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/contrib/jetty/FAQ?rev=HEAD&content-type=text/vnd.viewcvs-markup


            Jules

            • 3. Re: serving jsps and classes from multiple locations with Je
              nznl

              Thanks Jules,

              I tried using the manifest file to set the classpath but it only seems to work for dir's relative to the webapp root i.e. I can use ../../.. to get to my dirs but if they are on a different drive then I'm out of luck. If I could get it working for an absolute classpath, I'd be in business.

              I checked the FAQ you recommended but it 1/ says that it's out of date and 2/ the jetty docs say that when you run jetty in jboss, you should use jboss config to set classpaths or you'll mess up the classloaders. This is fine but where do you go to set classpaths for jboss? I don't mind if it is not context/webapp specific.