Consider the following code sending an HTTP 201 \"Created\" response to the client:
String url = \"/app/things?id=42\"; // example
response.setStatus(Htt
Just send the absolute path. The restriction to an absolute URI is a known defect in RFC 2616 and will be fixed in HTTPbis (see http://trac.tools.ietf.org/wg/httpbis/trac/ticket/185).
Please note that RFC 7231 now includes relative URIs in the spec. See other answers for how to handle relative URIs.