Note that there are some explanatory texts on larger screens.

plurals
  1. POConfiguring a Tomcat webapp to serve static content from external directory
    primarykey
    data
    text
    <p>I hope this is not too trivial - I'm very new at Tomcat administration.</p> <p>I'm building the development deployment process for a brand-new web application. We have the client assets and the web services the client will talk to in separate directories. The services are served from a Tomcat 6 webapp, being served at /my-app/services/.</p> <p>I need to update the configuration such that the Tomcat webapp will serve up the static client assets from the client directory as well as the web services. Ideally, these static assets will be served from /my-app/, with just the services directory reserved for the dynamic content.</p> <p>Currently tomcat is configured with the single webapp containing a trivial context.xml in META-INF. I have tried setting up two contexts manually in server.xml, and also setting both contexts up in tomcat/conf// (naming them my-app#services.xml and my-app.xml respectively, and setting the docBase of my-app.xml to the relative path to the client assets directory). Setting it up like this results in the web services content no longer successfully starting (failing to find the required classes), but the static content is now served from the correct path.</p> <p>I'm really at a loss as to what to do here. If somebody with Tomcat experience could just sketch out the appropriate solution for this problem, I would be so grateful. If the functionality I've described above is not workable, minor changes are totally feasible - I just want to get something working so that I can go back to writing code!</p> <p>NB: We want to keep the static client assets separate from the services, as this lets us keep the two systems decoupled, and also lets us more easily do fancy things with client deployment such as watching the source files and re-running the unit tests when things change.</p> <p>Thanks in advance for any help offered.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload