2

I am using Jersey 1.8 with Tomcat 6 to develop the RESTful server. I have the following service to receive the HTTP request by GET with parameter Input String.

@GET
@Path("/searchTest/{inputString}")
@Produces(MediaType.APPLICATION_JSON)
@Override
public Response searchTest(@PathParam("inputString") String inputString) throws Exception {
    // TODO Auto-generated method stub
    System.out.println(inputString);

    return Response.status(Status.OK).entity("OK").build();
}   

However, if the request parameter included space like : http://localhost:8080/test/service/searchTest/231 2312

The value of the server received is 231%202312

Here mentioned that @PathParam will decode automatically because this not work for me. Jax-rs automatic decode pathparam

Anyone can help?

leonlai
  • 269
  • 2
  • 4
  • 12

0 Answers0