Case-insensitive URLs with JAX-RS

Is there any easy way to provide a case-insensitive URLs in a JAX-RS web service? The goal of this is to produce a web service which is a "lenient acceptor."1

I imagine it's possible to do this with a filter which .to[Lower|Upper]Case()s all incoming URLs. Unfortunately, this implementation demands programmer discipline/consistency in making sure that all hard-coded URL strings in the application are strictly [lower|upper]case.
Also, I don't yet know the JAX-RS analog to a servlet filter.

If it matters, I'm using Jersey as my JAX-RS implementation.


1As in, "be lenient in what you accept, and strict in what you produce" (can't recall the source)

8
задан Matt Ball 11 April 2011 в 16:36
поделиться