Skip to content

Files

Latest commit

Feb 11, 2021
f3feded · Feb 11, 2021

History

History
25 lines (18 loc) · 505 Bytes

uri-info.md

File metadata and controls

25 lines (18 loc) · 505 Bytes

Get URI Information

@Context
private UriInfo info;

@GET
public response myGetMethod() {
    String baseUril = info.getBaseUri().toASCIIString();
}

The UriInfo interface also specifies methods to get the path, request URI, and query parameters.

Other uses of @Context.

public Response test(@Context HttpServletRequest request) {
    String authInfo = request.getHeader("Authorization")
}

References

  1. JAX-RS @Context tutorial