5 Replies Latest reply on Jan 13, 2005 6:05 AM by jeyalakshminethaji

    Serving static pages with JBoss3.0.4/Catalina4.0.6

    skidvd

      Hello:

      First some brief background....

      I have been using JBoss 3.0.4 with embedded Catalina 4.0.6
      successfully for quite some time now.
      I typically run multiple web apps (both JSP and servlets) as
      well as a number of EJBs. These
      applications have a combination of both static html pages (very
      few) as well as dynamically
      generated pages (most of them are like this). In either case,
      everything that is needed for a
      specfic app is contained in its associated war file(s).

      Recently, I had a new requirement though that I need some
      assistance with. Unlike my typcial
      situation above, I now have a hiearchal directory of truely
      static pages that needs to be served
      in combination with one of my more typical dynamic apps.

      I placed the directory into the deploy directory and thought
      that all would be fine. However,
      this did not work (page not found errors) as I navigated to
      http://ip:port/<path to static page>.
      I then decided to wrap the static page directory hiearchy inside
      of an exploded war file
      directory structure with a trivial web.xml descriptor. This
      get's me further in that if I
      now navigate to http://ip:port//<path to static page>,
      the browser will find it for
      SOME files. Basically everything that is in the top directory
      of static directory hiearchy is
      now visible. However, anything referencing something in any of
      the static subdirs provides the
      "page not found" error.....

      I've looked into the tomcat-service.xml and played with adding a
      specifc context with a different
      docbase to no avail. I'm sure I'm missing something simple as
      I've never had to worry about
      this before. I'd appreciate any assistance and appropriate
      config file snippets.

      Thanks!

        • 1. Re: Serving static pages with JBoss3.0.4/Catalina4.0.6
          wiberto

          Did you every find a solution to this problem? I want to do the same thing.

          I want to have some static content in a predetermined directory, not a temp directory from an expanded war that could change at any time.

          Thanks,

          Jose

          • 2. Re: Serving static pages with JBoss3.0.4/Catalina4.0.6
            starksm64

            jboss-3.0.4 did not support this level of integration. jboss-3.2.3 does by adding a Context entry to the jbossweb-tomcat41.sar/META-INF/jboss-service.xml descriptor:

            <server>
            
             <mbean code="org.jboss.web.tomcat.tc4.EmbeddedTomcatService"
             name="jboss.web:service=WebServer">
            ...
             <attribute name="Config">
             <Server>
             <Service name="JBoss-Tomcat">
             <Engine name="MainEngine" defaultHost="localhost">
             <Logger className="org.jboss.web.tomcat.Log4jLogger"
             verbosityLevel="debug" category="org.jboss.web.localhost.Engine"/>
            ...
             <Host name="localhost">
            ...
             <!-- Default context parameters -->
             <DefaultContext cookies="true" crossContext="true" override="true"/>
            
             <!-- Add a static context /images using directory /tmp/images -->
             <Context docBase='C:/tmp/images' path='/images' />
            ...
            



            • 3. Re: Serving static pages with JBoss3.0.4/Catalina4.0.6
              alex75

              Is there a possibility to do only the context-configuration in the some.war/WEB-INF/web.xml ord some.war/WEB-INF/jboss-web.xml.

              So I'd like to have my some.war-directory deployed in the default /deploy directory which includes the WEB-INF subdirectory. But the static HTML-content is outside of the some.war-directory.

              Thanks, Alex.

              • 4. Re: Serving static pages with JBoss3.0.4/Catalina4.0.6
                mbh

                I was able to create a static context using 3.2.3 by adding the Context to jboss-service.xml as above.

                However, when I tried to do the same thing with 3.2.5 by adding a Context tag in server.xml, it didn't work. Can someone tell me how to do this with the new Tomcat configuration?

                Thanks.

                • 5. Re: Serving static pages with JBoss3.0.4/Catalina4.0.6
                  jeyalakshminethaji

                  did anyone try in jboss-3.2.0? If so, please let me know the procedure. I tried the instructions given in http://www.jboss.org/wiki/Wiki.jsp?page=ExternalDirectories but they did not help me. They have explained only for jboss-3.2.3 onwards but not for jboss-3.2.0.

                  Immediate reply in this regard would be helpful.

                  Thanks