public class TrailingSlash extends Object
UriInfo
ends or doesn't end with a slash ('/'). If the URI does not
conform, then a WebApplicationException
is thrown. This exception contains a response with status code 303 ("See-Other"),
causing a redirect to the correct URI.
Constructor and Description |
---|
TrailingSlash() |
Modifier and Type | Method and Description |
---|---|
static void |
enforceNotPresent(javax.ws.rs.core.UriInfo uriInfo)
Checks if no slash ('/') is present at the end of the URI given by
UriInfo . |
static void |
enforcePresent(javax.ws.rs.core.UriInfo uriInfo)
Checks if an slash ('/') is present at the end of the URI given by
UriInfo . |
public static void enforcePresent(javax.ws.rs.core.UriInfo uriInfo)
UriInfo
. If not then a redirect is triggered to the URI with
the slash at the end.uriInfo
- public static void enforceNotPresent(javax.ws.rs.core.UriInfo uriInfo)
UriInfo
. If a slash is present, a redirect is triggered to
the URI with no slash at the end.uriInfo
- Copyright © 2014 The Apache Software Foundation. All Rights Reserved.