[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wink-dev
Subject:    [jira] [Created] (WINK-414) @QueryParam annotation provides wrong parameter value when the query par
From:       Alexander_Schäfer_(JIRA) <jira () apache ! org>
Date:       2013-10-23 8:29:43
Message-ID: JIRA.12675213.1382516982754.109004.1382516983719 () arcas
[Download RAW message or body]

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)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic