3 Replies Latest reply on Jun 20, 2003 8:00 AM by Jon Barnett

    Deploy web app not in war?

    Rodney Kite Newbie

      How do you configure a web app which is not in a war in JBoss 3.0.6/Tomcat? I have a web/ejb application in a ear that works but would like to take some unrelated static content and also serve from the embedded tomcat.

      How can I serve this web content like I do in Tomcat stand alone. In Tomcat stand alone I just configure server.xml to point to the top directory of the html/jsp pages.

      Thanks
      Rodney

        • 1. Re: Deploy web app not in war?
          null null Newbie

          name your web application folder with
          the war extension...



          • 2. Re: Deploy web app not in war?
            jovial Newbie

            And what do you do when the content you want to include is not in the JBOSS_DIST/server/your_app_name folder?

            I have tons of files with different file formats (images, audio and video) that are referenced by the application. I don't want to copy everything to the
            JBOSS_DIST/server/your_app_name folder because there are too many files.
            From the documentation JBoss/Tomcat is not allowing creation of any sub-context below the virtual Web server. Is there any way to circumvent this inconvenience?

            thanks,

            dimitar

            • 3. Re: Deploy web app not in war?
              Jon Barnett Master

              Tomcat or Jetty need to be given an indication fo where a package is to be deployed (the context). All servlet containers require this. It doesn't stop you from deploying static content and it does not stop you from deploying static content under the root context. But you need a deployment descriptor for it.

              JBoss places its own constraints on this. It needs to know what the package is, so it can farm the deployment to the right system(s) (EJB container or servlet container).

              Your static content can live in directories (any content actually), can live outside the internal deployment directories. You need to configure JBoss to scan the right places. However, your content directory (expanded) will need to have a .war extension so that JBoss knows it is a web application for deployment. Also, you need to create all the necessary things a WAR must have - namely a deployment descriptor, WEB-INF/web.xml under the topmost directory of this content heirarchy.

              For JBoss, if you want to map the context explicitly, you will need WEB-INF/jboss-web.xml. For example, if you want to map the content to the root context, jboss-web.xml would contain:
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN"
              "http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd">
              <jboss-web>
              <context-root>/</context-root>
              </jboss-web>

              To find the content outside of the standard deployment directory, configure the URL scanner to look at your required points - controlled in server/instance/conf/jboss-service.xml, for the URLs attribute of your URLDeploymentScanner, assuming that the content for your ROOT context resides in ROOT.war at the top of the file hierarchy of the current disk:


              deploy/,file:/ROOT.war


              This includes your expanded WAR content (it can even be a packaged WAR) in the deployment process.

              Hope that helps.