JBoss RewriteValve Madness

If you’re trying to do some URL-rewriting with JBoss’s org.jboss.web.rewrite.RewriteValve and finding that the “-f” options don’t work correctly on RewriteCond, it may be because the damned code hasn’t been finished on JBoss’s side, despite what the RewriteValve documentation implies. I dug up the RewriteCond source on GrepCode and every version I looked at (2.1.0.GA all the way through the version 3 alphas) simply returns “true” for a ResourceCondition test, whether or not your file actually exists, instead of running through the TomcatResolver to check.

Very, very broken. Hopefully this helps someone not waste hours on it like I did — it’s bad enough that it’s next-to-impossible to get useful logging going, but finding out the code was never implemented after all of that effort induces hair-pulling. For my personal project, I was trying to serve up a “default” theme for a customizable user interface if a more specific skin hadn’t been specified, but I can’t test for the existence of a more specific skin within JBoss, so I guess I’ll have to install something like Apache that actually works and serve up the skins externally. Ah well.

Leave a Reply

Your email address will not be published. Required fields are marked *