title: Getting whole query string from REST GET service call
body: <p>Is there a way to get the whole query string without it being parsed? As in:</p>
  
  <pre><code>http://localhost:8080/spring-rest/ex/bars?id=100,150&amp;name=abc,efg
  </code></pre>
  
  <p>I want to get everything following the ? as one string. Yes I will parse it later, but this allows my controller and all follow-on code to be more generic. </p>
  
  <p>So far I've tried using @PathParam, @RequestParam as well as @Context UriInfo with the results following. But I can't seem to get the whole string. This is what I want:</p>
  
  <pre><code>id=100,150&amp;name=abc,efg
  </code></pre>
  
  <p>Using curl @PathParam using </p>
  
  <blockquote>
    <p><a href="http://localhost:8080/spring-rest/ex/bars/id=100,150&amp;name=abc,efg" rel="noreferrer">http://localhost:8080/spring-rest/ex/bars/id=100,150&amp;name=abc,efg</a></p>
  </blockquote>
  
  <p>produces id=100,150</p>
  
  <pre><code>  @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("/spring-rest/ex/qstring/{qString}")
    public String getStuffAsParam ( @PathParam("qstring") String qString) { 
           ...
    }
  </code></pre>
  
  <p>@RequestParam using  </p>
  
  <blockquote>
    <p><a href="http://localhost:8080/spring-rest/ex/bars?id=100,150&amp;name=abc,efg" rel="noreferrer">http://localhost:8080/spring-rest/ex/bars?id=100,150&amp;name=abc,efg</a></p>
  </blockquote>
  
  <p>gives name not recognized.</p>
  
  <blockquote>
    <p><a href="http://localhost:8080/spring-rest/ex/bars?id=100,150;name=abc,efg" rel="noreferrer">http://localhost:8080/spring-rest/ex/bars?id=100,150;name=abc,efg</a></p>
  </blockquote>
  
  <p>produces exception.</p>
  
  <pre><code>  @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("/spring-rest/ex/qstring")
    public String getStuffAsMapping (@RequestParam (value ="qstring", required = false) String[] qString) { 
      ...
    }
  </code></pre>
  
  <p><strong>EDIT - THE APPROACH BELOW IS WHAT I'D LIKE TO FOCUS ON.</strong>
  <P>This works almost. It doesn't give me the full query string in the MultivaluedMap. It is only giving me the first string up to the &amp;. I've tried using other characters as the delimiter and still doesn't work. I need to get this string in its undecoded state.</p>
  
  <p>@Context with UriInfo using  </p>
  
  <blockquote>
    <p><a href="http://localhost:8080/spring-rest/ex/bars?id=100,150&amp;name=abc,efg" rel="noreferrer">http://localhost:8080/spring-rest/ex/bars?id=100,150&amp;name=abc,efg</a></p>
  </blockquote>
  
  <p>gives value for queryParams id=[100,150]. Again the <b>name=</b> part was truncated.</p>
  
  <pre><code>  @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("/spring-rest/ex/qstring")
    public String getStuffAsMapping (@Context UriInfo query) { 
        MultivaluedMap&lt;String, String&gt; queryParams = query.getQueryParameters();
      ...
    }
  </code></pre>
  
  <p>I'm thinking the query string is being decoded which I don't really want. How do I get the whole string?</p>
  
  <p>Any help is greatly appreciated. </p>