Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] recommended approach for multiple context paths

Hello there, everyone!

I'm wondering what the recommended approach is to support multiple context paths (four, actually) for one webapp.

I see a few possible solutions, but I haven't gotten it to work:
  1. custom Handler to forward traffic to my webapp
  2. subclass WebAppContext and override context path verification
  3. multiple WebAppContext declarations in XML files inside contexts/
  4. use a RewriteHandler 

  1. Haven't gotten it to work :(  Just getting a reference to the Handler for my webapp and "forwarding" the request via Handler.handle() doesn't seem to do the trick.  I'm probably doing it wrong, but I haven't found an example.
  2. Code needs to live outside WAR in lib/ext/ or some much location.
  3. WAR is actually extracted multiple times, i.e., classes are loaded multiple times, which breaks singletons.
  4. Request URL / path info is rewritten (although retrievable using httpRequest.getAttribute(), I know).
My ideal solution would simply forward the request to my webapp without changing the URL or having multiple copies of the WAR loaded or extracted.

Thoughts and suggestions would be greatly appreciated. Thanks! :)

Back to the top