I have two static wars filled with help files served by a Jetty server and a root context war.
- help.war - English help files
- help_CS.war - Czech help files
ROOT.war
Based on the locale of the request, I want to divert a user to the language relevant to them. i.e. user requests /help/index.htm and as they are requesting from a Czech locale, they get /help_CS/index.htm. The idea is that language packs can be added as required without too much fuss.
I tried adding a custom RewriteHandler, referred to in Jetty.xml which grabs the locale from the Request and either forwards or redirects on handle(). Both complain as response codes have been sent by this point...somehow?!
I tried a custom Filter in the web.xml of the ROOT.war which I couldn't get to match */help/** no matter what variation of the url-pattern I tried.
I then added a reference to the same Filter as the last attempt into WEB-INF/web.xml to my help.war which would match and URLS could be generated but I can't rewrite the URL at this point because it is always prepended by /help/ so the URL with help replaced with help_CS ends up as domain/help/help_CS/index.htm.
So my question. How should/could this be done?