I have anchored REST services/methods to URI template by @Path annotation. It looks like as usual:
@GET
@Path("/message")
@Produces("application/json")
public Response getMessage() { ... }
But my REST service has to be case-insensitive. Now I’m using regular expression in @Path in all my code like that:
@GET
@Path("/{message:[mM][eE][sS][aA][gG][eE]}")
@Produces("application/json")
public Response getMessage() { ... }
This looks weird. Is there something I overlooked in specification (I hope not, see this) or has any of JAX-RS implementations special feature for that? Now I’m using JBoss RESTeasy.
Thanks.
i don’t know resteasy, but if it supports all java regex syntax, you could use
(?i:message)instead of your pattern.