users@jersey.java.net

Case Insensitive QueryParams

From: Touve, Larry E \(US SSA\) <"Touve,>
Date: Tue, 10 Mar 2009 18:55:14 -0700

Hi,

 

Is there any way to declare queryparams that are case insensitive? I'd
like to do something like:

 

@PATH("/CSW")

Public class myclass

{

  :

    @GET

    @Produces(MediaType.APPLICATION_XML)

    public Response get(@QueryParam("service") String service,
@QueryParam("request") String request, ...)

    {

        <some code...>

    }

 

And be able to send requests like:

http://localhost:8080/APP/CSW?service=CSW&request=GetRecords&...

As well as

http://localhost:8080/APP/CSW?SERVICE=CSW&REQUEST=GetRecords&...

Or even

http://localhost:8080/APP/CSW?Service=CSW&Request=GetRecords&...

 

I am currently calling uri.getQueryParameters to get the map, and can
toUpperCase all the keys, but I'd like to utilize the QueryParam
annotations for the mandatory query parameters. Has anyone come across
a situation like this before?

 

 Thanks,

 Larry