Validate using a URI value
To
vaildate the REST path, create a ping route that returns a passed URI value. The
sample establishes the following URL path for the query:
- Authenticated: http://localhost:8095/{tenantGuid}/ext/sample/ping/Hello
- Unauthenticated: http://localhost:8095/{tenantGuid}/ext/open/sample/ping/Hello
The following code is the same in both samples, but
SampleOpenController.java uses
AbstractController.OPEN_PATH_PREFIX
instead. SampleController.java
@GET @Path("/ping/{pingValue}") public void pingUriRoute(@PathParam("pingValue") String pingValue, @Suspended final AsyncResponse asyncResponse) { // Log the request LOGGER.debug("{}/sample/ping/{}", AbstractController.PATH_PREFIX, pingValue); // Send back the response. The pingValue is always set because this is a path parameter asyncResponse.resume(Response.ok(pingValue).build()); }