I have a GWT that needs to access some static resources. I don't want to place these resources in the actual /src/main/webapp directory (note: using Maven and corresponding layout) because they're not part of the app, but part of the data.
My problem is not how to give the application access to these resources at deployment time; that should be easy to do via Tomcat configuration. Rather the problem is how to give my app access to some test data during development. I have some test static files in a directory outside my GWT app tree, and would like to configure GWT's dev mode Jetty server to access those resources. That is, I want to be able to say mvn gwt:run (or run or debug the app in dev mode from Eclipse), and have the server serve those static resources.
I know about (and use) the dev mode -noserver option. However, since I'm modifying the server-side code a lot, along with the client code, it's not practical to redeploy the server every time the server code changes.
So far what I've been trying is to create a jetty-web.xml file in my WEB-INF directory, and add a new context so the server will serve my resources. Here are my failed jetty-web.xml attempts:
<Configure id="parentHandler" class="org.mortbay.jetty.handler.ContextHandler">
<Set name="contextPath">/static_resources</Set>
<Set name="resourceBase">/real/filesystem/path/to/static/resources/</Set>
<Set name="handler">
<New class="org.mortbay.jetty.handler.ResourceHandler">
<Set name="cacheControl">max-age=3600,public</Set>
</New>
</Set>
</Configure>
If I put that in jetty-web.xml, then when I start dev mode, Jetty does serve my external resources, but doesn't serve my GWT app.
On the other hand, if I do this...
<Configure id="parentHandler" class="org.mortbay.jetty.handler.ContextHandler">
<New id="newHandler" class="org.mortbay.jetty.handler.ContextHandler" >
<Set name="contextPath">/static_resources</Set>
<Set name="resourceBase">/real/filesystem/path/to/static/resources/</Set>
<Set name="handler">
<New class="org.mortbay.jetty.handler.ResourceHandler">
<Set name="cacheControl">max-age=3600,public</Set>
</New>
</Set>
</New>
<Get id="server" name="server">
<Call name="setHandler">
<Arg><Ref id="newHandler" /></Arg>
</Call>
</Get>
<Ref id="newHandler">
<Set name="server"><Ref id="server" /></Set>
</Ref>
</Configure>
...Jetty serves neither my static stuff nor my GWT app.
Any suggestions? What am I doing wrong?
(Note: GWT dev mode uses version 6 [or 6.something] of Jetty, and sets it up programmatically, so as far as I can see, no other Jetty config files are read in.)
Many thanks!