|
From: Howard M. L. S. <hls...@co...> - 2004-06-22 21:53:12
|
I'm trying to do something a little unusual. I'm retrofitting an = existing application to use Tapestry, and I'm using Jetty for my debugging. This site can be deployed with one of several "skins". For testing purposes, I want to be able to run Jetty for my workspace as = a web application (i.e., with WEB-INF and all that). However, I want to map /skin within my = context to another directory. Mostly, this works correctly. I've gotten this to partially work with this jetty.xml: <?xml version=3D"1.0" encoding=3D"ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure = 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd"> =20 <Configure class=3D"org.mortbay.jetty.Server"> <Call name=3D"addListener"> <Arg> <New class=3D"org.mortbay.http.SocketListener"> <Set name=3D"port">8080</Set> </New> </Arg> </Call> =20 <Call name=3D"addWebApplication"> <Arg>/skin</Arg> <Arg>web/context</Arg> </Call> =20 <Call name=3D"addWebApplication"> <Arg>/</Arg> <Arg>web/defaultskin<Arg> </Call> =20 </Configure> In fact, from the browser, = http://localhost:8080/skin/images/tab_about.gif (for example) works just fine (the file live in my worksapce, under web/defaultskin/images). I debugged this in my application, and got to the call to = ServletContext.getResource(). I did some debugging, and got to the point where my code asks the = ServletContext about the file. _context.getResource("/skin/images/tab_about.gif") returns null _context, in this case, is an instance of = org.mortbay.jetty.servlet.ServletHandler$Context I guess this makes sense, the file in question isn't inside the context = its in a parallel context. But that doesn't help me. So, what I need to do is rearrainge this to "nest" the context for = "/skin" inside my main web application context. I haven't been able to figure out the right incantation for this. Any = takers? My work around for this is less than ideal: copy the merged content of = my main context directory and the skin directory to form a new directory. I just don't want to = have to run Ant after every change of my files, so I'm trying to accomplish the same result = virtually, at runtime. Doesn't seem unreasonable to me. -- Howard M. Lewis Ship Independent J2EE / Open-Source Java Consultant Creator, Jakarta Tapestry Creator, Jakarta HiveMind http://howardlewisship.com |