users@jersey.java.net

Re: [Jersey] curious query with LIKE in JPA + Jersey

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 26 May 2009 13:29:25 -0700

On May 26, 2009, at 12:33 AM, Felipe Gaścho wrote:

> I implemented a search method in my web-service, a simple query using
> LIKE %foo%, and then I experimented a strange result:
>
> this URL returns some db rows:
> http://fgaucho.dyndns.org:8080/footprint-service/user/search?name=Gaucho
>
> this URL doesn't:
> http://fgaucho.dyndns.org:8080/footprint-service/user/search?name=Gaścho
>
> Notice the correct value of the name field in the database is
> "Felipe Gaścho"
>
> so, why "Gaucho" matches the name and "Gaścho" (with character ś)
> doesn't ?
>

The URI containing the ś character will actually be:

   http://fgaucho.dyndns.org:8080/footprint-service/user/search?name=Ga%C3%BAcho

Jersey will correctly decode this with "@QueryParam("name") String
name".

How are you extracting out the query parameter?

Paul.

> somewhere between the URL and the database query the character is
> being transformed.. now I need to find where........
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>