how to get case sensitive query parameters ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to get case sensitive query parameters ?

Laurent Rustuel-4
Hello,
I'm using Restlet 2.3.4 with a JAX-RS application.
I looking to retrieve query parameters, and thus in my resource I use the following :

public Response get(@Context UriInfo info ) {

final MultivaluedMap<String, String> queryParameters = info.getQueryParameters(true);
[...]
}
but I the result is case insensitive parameters. I see that in CallContext.java, the method getQueryParameters(boolean decode) use
UnmodifiableMultivaluedMap.getFromSeries(queryForm, false)
where false is used to set case insensitivity. So this seems a dead end, without changing code. Is there another way to get query parameters as case sensitive ?

Regards,
Laurent.

To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: how to get case sensitive query parameters ?

Thierry Templier-3
Hello,

Perhaps you could try to use the QueryParam annotation of JAX-RS. In this case, query parameter names are case sensitive:

public SomeClass test(@Context UriInfo info, @QueryParam("testDD") String test) {
  // test contains the value of the query parameter "testDD"
}

I opened an issue in the Restlet Github regarding your problem: https://github.com/restlet/restlet-framework-java/issues/1163.

Hope it helps you,
Thierry

Le mercredi 4 novembre 2015 11:26:28 UTC+1, Laurent Rustuel a écrit :
Hello,
I'm using Restlet 2.3.4 with a JAX-RS application.
I looking to retrieve query parameters, and thus in my resource I use the following :

public Response get(@Context UriInfo info ) {

final MultivaluedMap<String, String> queryParameters = info.getQueryParameters(true);
[...]
}
but I the result is case insensitive parameters. I see that in CallContext.java, the method getQueryParameters(boolean decode) use
UnmodifiableMultivaluedMap.getFromSeries(queryForm, false)
where false is used to set case insensitivity. So this seems a dead end, without changing code. Is there another way to get query parameters as case sensitive ?

Regards,
Laurent.

To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: how to get case sensitive query parameters ?

Thierry Boileau-4
Hi,

thanks Laurent for your contribution. The fix is now part of version 2.3.6 of the Restlet Framework.

Best regards,
Thierry Boileau

Le mardi 10 novembre 2015 07:48:16 UTC+1, ttemplier a écrit :
Hello,

Perhaps you could try to use the QueryParam annotation of JAX-RS. In this case, query parameter names are case sensitive:

public SomeClass test(@Context UriInfo info, @QueryParam("testDD") String test) {
  // test contains the value of the query parameter "testDD"
}

I opened an issue in the Restlet Github regarding your problem: <a href="https://github.com/restlet/restlet-framework-java/issues/1163" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Frestlet%2Frestlet-framework-java%2Fissues%2F1163\46sa\75D\46sntz\0751\46usg\75AFQjCNH7dxaZjRwVAieQRYxB9IiFqwbRUw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Frestlet%2Frestlet-framework-java%2Fissues%2F1163\46sa\75D\46sntz\0751\46usg\75AFQjCNH7dxaZjRwVAieQRYxB9IiFqwbRUw&#39;;return true;">https://github.com/restlet/restlet-framework-java/issues/1163.

Hope it helps you,
Thierry

Le mercredi 4 novembre 2015 11:26:28 UTC+1, Laurent Rustuel a écrit :
Hello,
I'm using Restlet 2.3.4 with a JAX-RS application.
I looking to retrieve query parameters, and thus in my resource I use the following :

public Response get(@Context UriInfo info ) {

final MultivaluedMap<String, String> queryParameters = info.getQueryParameters(true);
[...]
}
but I the result is case insensitive parameters. I see that in CallContext.java, the method getQueryParameters(boolean decode) use
UnmodifiableMultivaluedMap.getFromSeries(queryForm, false)
where false is used to set case insensitivity. So this seems a dead end, without changing code. Is there another way to get query parameters as case sensitive ?

Regards,
Laurent.

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].