I'm trying to pass an SQL query as a query parameter:
"select p from VirtualMachineEntity p where guest.guestId = :id"
Method signature is:
@POST
@Path("/compile")
public Query compile( @QueryParam("query") String queryText );
Class is annotated with
@Produces("application/xml")
@Consumes("application/xml")
In org.jboss.resteasy.util.Encode#encodeQueryString and org.jboss.resteasy.util.Encode#encodeSegment, look like the arguments in some of the calls to String#replace are backwards.
For instance,
URLEncoder.encode(segment, "UTF-8").replace("+", "%20").replace("%3B", ";").replace("%3D", "=").replace("%25", "%");
Should that be:
URLEncoder.encode(segment, "UTF-8").replace("+", "%20").replace(";","%3B").replace("=","%3D").replace("%","%25");
?
Thanks!