1 Reply Latest reply on Nov 28, 2005 1:06 PM by James Reader

    Accessing an external directory for a webapp

    James Reader Newbie

      I have a fresh installation of jboss4.0.3SP1 running as a service.

      There is an existing application that is currently running on Tomcat Standalone i'll call foo.war, deployed under localhost for testing

      to access the page i type http://localhost:8080/foo and it runs the top page.

      What I need is for http://localhost:8080/foo/pdf to point to a directory C:\webfiles\foo\pdf.

      I have tried adding context.xml to the WEB-INF directory of the War

      as well as adding it to server.xml file for tomcat, but the only thing that occurs is when i go to localhost:8080/foo, it just redirects to the C:\webfiles\foo\pdf path.

      How can I make jboss simply take requests for a certain folder to go to another directory. Its just a simple redirect, but there is nothing in the documentation showing how this is done.

      Thanks for any help in advance.

        • 1. Re: Accessing an external directory for a webapp
          James Reader Newbie

          Update: I was able to get it "working" by doing the following two things.

          Copied JBOSS_HOME>/server/default/deploy/jbossweb-tomcat50.sar/web.xml to <JBOSS_HOME>/server/<config-name>/conf/web.xml

          And added a Context entry to jbossweb-tomcat50.sar/server.xml

          I would like to be able to do this within the META-INF\context.xml from the war itself to provide as much mobility as possible for the servlet. Simply moving the context from server.xml to context.xml doesn't work. Instead it redirects all requests to that app to the external directory.

          As of now, I am wondering if this is a bug in tomcat and not a configuration error. The Host and Context handling in both tomcat and jboss-tomcat are a huge mess.