Alexander Schäfer created WINK-414:
--------------------------------------

             Summary: @QueryParam annotation provides wrong parameter value 
when the query parameter starts with a plus sign (+)
                 Key: WINK-414
                 URL: https://issues.apache.org/jira/browse/WINK-414
             Project: Wink
          Issue Type: Bug
          Components: Common, Server
    Affects Versions: 1.4
         Environment: OS: Windows 7, 32 Bit, 4 GB RAM
Java: JDK 1.6 U45
Web-Container: Apache Tomcat 6
Rest-Client-Dojo-Framework 1.9.1
Wink: Apache Wink 1.4.0
            Reporter: Alexander Schäfer
            Priority: Minor


When I send a HTTP GET request to the server component and the request contains 
a query parameter that starts with a plus sign (+), this sign gets filtered out 
and replaced by a whitespace character if it is accessed through the 
@QueryParam annotation.

Example: 

Client-Side: 
------------------------
HTTP Request URL: /application/rest/resources/users/?sortBy=+firstname
HTTP Method: GET

Server Side:

{code:title=UserResource.java|borderStyle=solid}
...
@GET
@Path("resources/users/")
@Produces(MediaType.APPLICATION_JSON)
public Response findAll (@QueryParam("sortBy") String sortBy, @Context UriInfo 
info) {
System.out.println("'"+sortBy+"'");
System.out.println("'"+info.getQueryParameters(true).get("sortBy")+"'");

}
...
{code}

This outputs
(1) *' firstname'*
(2) *'+firstname'*

But IMHO the outputs (1) and (2) should be identical.






--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to