6 Replies Latest reply on Nov 21, 2014 4:34 AM by jfclere

    Deploy WAR with files also outside WAR

      I deploy a WAR as part of an EAR file. The WAR includes all HTML, images, etc. Is there a way to have the HTML and images outside the WAR in a static directory so the HTML developers can publish and make changes with having to deploy the entire EAR (which has the WAR) again.

      I think I saw an FAQ on this awhile ago, but I can't locate it now.

      Thanks for any help or direction.

      Jeff

        • 1. Re: Deploy WAR with files also outside WAR
          mplesser

          This is a great way to get it to work using jetty, but our app relies on portability across application servers.
          Prior to tomcat 4.0.4 there was no problem writing files on the fly to the deployment directory using getRealPath(..). But thanks to tomcat developers and their rather strange strange interpretion of 'unpackWARs=TRUE' tomcat refuses to unpack hot deployed ears/wars which is the case when using the ear deployer from jboss with bundled tomcat.
          Point is we need to write jsp files on the fly and have them processed by tomcat.
          Is there any way to deploy them outside tomcat or 'force' tomcat to unpack his war files??

          regards,
          -markus

          • 2. Re: Deploy WAR with files also outside WAR
            meetian

            One way is:
            extract the war to a directory
            suppose the war is call web.war
            You can make a directory called "web.war"
            and extract all the files to "web.war" directory
            Then share this folder to your team member
            But It seems not a good idea..
            I am also finding another way

            James

            • 3. Re: Deploy WAR with files also outside WAR
              erik777

              If you tie Apache to Tomcat, you can configure Apache to only forward requests for JSP/servlets, or any other type. Thus, Apache will use a regular web root to obtain all other pages (HTML, images, etc,...). This is what I do. Works great.

              Note that any file your JSPs/servlets reference must still be in your war, such as images. You may need to put the images in both places if you have html and JSP pages referencing them.


              • 4. Re: Deploy WAR with files also outside WAR
                didi

                I have 600 MB images. How can I do this? Create a war-file with a size of 600 MB ?

                • 5. Re: Deploy WAR with files also outside WAR
                  zzpprk

                  The FAQ refered to above points to a dead page!

                   

                  I have a web application in a WAR file (call it webapp.war) which I can deploy to JBoss. I would like to take a single file out of that WAR so I can modify it on the server there and then if I need to. Can I do that with a single file or do I have to extract the whole WAR? In effect, what I want to end-up with is webapp.war (without my extracted file) and a directory also called webapp.war containing my extracted file in the correct directory tree.

                  • 6. Re: Deploy WAR with files also outside WAR
                    jfclere

                    you need to extract the whole war.