3 Replies Latest reply on May 9, 2003 9:13 PM by jonlee

    Static content in web applications

    einfo

      What's the best way to reference static content? I can include it in the war file and then add a mapping in the jetty configuration file but I really would rather not have to repackage/deploy all of those images/pdfs everytime I make a change to a jsp file.

      Anyway to configure Jetty to look at a folder outside of the war file? What's the best way to set things up for maintainability?

        • 1. Re: Static content in web applications
          padmal

          What is the your requierment? Do you want to deploy and view it through the web browser or do u want without deploying view it?

          • 2. Re: Static content in web applications
            einfo

            I guess what I'm really after is a way to tell Jetty that any file requested in the war file that is not a jsp or a registered servlet should be returned as static content. Any ideas?

            • 3. Re: Static content in web applications
              jonlee

              You'll find that Jetty already has the standard mime-types programmatically configured. So if you have JPGs and the like in your WAR file and you try to access them, they will be displayed. For any exotic content, you will need to add the mime-type mappings either in the Jetty webdefault.xml or in your own WAR's web.xml file.

              Tomcat has it's mime-type mappings in the parent web.xml.

              This is no different to configuring a web server for serving static content.

              Hope the answers your questions.