public class RequestUtils extends Object
Request
related utilities.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HTTP_FORWARDED_FOR_HEADER
Default HTTP Forwarded-For header name.
|
static String |
HTTP_FORWARDED_FOR_HEADER_PARAM
Servlet context init parameter name for custom HTTP Forwarded-For header name(s).
|
Modifier and Type | Method and Description |
---|---|
static String |
getFarthestRemoteAddr(org.apache.wicket.request.Request request)
Returns the remote client address or null if remote client address information is unavailable.
|
static String |
getFarthestRequestHost(javax.servlet.http.HttpServletRequest request)
Returns the original host information requested by the client
|
static String |
getFarthestRequestScheme(javax.servlet.http.HttpServletRequest request) |
static String |
getFarthestUrlPrefix(javax.servlet.http.HttpServletRequest httpServletRequest) |
static String |
getFarthestUrlPrefix(org.apache.wicket.request.Request request) |
static String[] |
getRemoteAddrs(org.apache.wicket.request.Request request)
Returns the remote host addresses related to this request.
|
static boolean |
isUserLoggedIn(org.apache.wicket.request.IRequestCycle requestCycle)
Returns
true if a user is logged in for the current request and false if not or if there is no
http session for the current request. |
public static final String DEFAULT_HTTP_FORWARDED_FOR_HEADER
X-Forwarded-For
by default.public static final String HTTP_FORWARDED_FOR_HEADER_PARAM
DEFAULT_HTTP_FORWARDED_FOR_HEADER
is used by default.public static String getFarthestRemoteAddr(org.apache.wicket.request.Request request)
request
- wicket requestpublic static String[] getRemoteAddrs(org.apache.wicket.request.Request request)
request
- wicket requestpublic static String getFarthestRequestScheme(javax.servlet.http.HttpServletRequest request)
public static String getFarthestRequestHost(javax.servlet.http.HttpServletRequest request)
request
- public static String getFarthestUrlPrefix(org.apache.wicket.request.Request request)
public static String getFarthestUrlPrefix(javax.servlet.http.HttpServletRequest httpServletRequest)
public static boolean isUserLoggedIn(org.apache.wicket.request.IRequestCycle requestCycle)
true
if a user is logged in for the current request and false
if not or if there is no
http session for the current request. This method uses the RequestCycle
from Wicket and assumes that
the request (if present) can be cast to a ServletWebRequest
.requestCycle
- the wicket request cycleCopyright © 2007–2019 Hippo B.V. (http://www.onehippo.com). All rights reserved.