public class ServletUtil extends Object
Constructor and Description |
---|
ServletUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getApplicationRequestedPath(HttpServletRequest request)
Returns the requested path, relative to the web application root.
|
static String |
getQueryStringParameter(HttpServletRequest request,
String parameterName)
Tries to read a request parameter from its
query string . |
static void |
sendMovedPermanentlyWithNoCache(HttpServletResponse response,
String location)
Sends a
HttpServletResponse.SC_MOVED_PERMANENTLY status with a no-cache header. |
public static String getApplicationRequestedPath(HttpServletRequest request)
request
- the http servlet request.public static String getQueryStringParameter(HttpServletRequest request, String parameterName)
query string
.
If the parameter has multiple values, any of them may be returned.request
- the request.parameterName
- the parameter name.null
if it was not found.public static void sendMovedPermanentlyWithNoCache(HttpServletResponse response, String location)
HttpServletResponse.SC_MOVED_PERMANENTLY
status with a no-cache header.
The 301 moved permanently HTTP response is cached by default. This method is a utility to send this type of response with caching disabled.
response
- the response to send the status.location
- the location to set in the response.LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.