public class HttpUtils
extends java.lang.Object
Constructor and Description |
---|
HttpUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
cookieName(java.lang.String suffix) |
static java.lang.String |
extractIP(java.lang.String result) |
static javax.servlet.http.Cookie |
getCookie(javax.servlet.http.HttpServletRequest req,
java.lang.String suffix)
return the cookie from the request.
|
static java.lang.String |
getCookieValue(javax.servlet.http.HttpServletRequest req,
java.lang.String suffix)
Returns a cookie value.
|
static java.lang.String |
getRemoteAddress(javax.servlet.http.HttpServletRequest req)
Returns the "real" remote address of a HttpServletRequest.
|
static java.lang.StringBuilder |
getRequestURLContext(javax.servlet.http.HttpServletRequest req) |
static javax.servlet.http.Cookie |
newCookie(java.lang.String suffix,
java.lang.String value) |
static void |
setCookieSecurity(javax.servlet.http.Cookie c,
javax.servlet.http.HttpServletRequest req) |
static void |
setNoCache(javax.servlet.http.HttpServletResponse res)
Set response to no-cache.
|
public static void setNoCache(javax.servlet.http.HttpServletResponse res)
res
- the HTTP-responsepublic static java.lang.String cookieName(java.lang.String suffix)
public static javax.servlet.http.Cookie newCookie(java.lang.String suffix, java.lang.String value)
public static void setCookieSecurity(javax.servlet.http.Cookie c, javax.servlet.http.HttpServletRequest req)
public static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest req, java.lang.String suffix)
req
- suffix
- the name part of the cookie that follows the server id.public static java.lang.String getCookieValue(javax.servlet.http.HttpServletRequest req, java.lang.String suffix)
req
- suffix
- the name part of the cookie that follows the server id.public static java.lang.String getRemoteAddress(javax.servlet.http.HttpServletRequest req)
req
- public static java.lang.String extractIP(java.lang.String result)
public static java.lang.StringBuilder getRequestURLContext(javax.servlet.http.HttpServletRequest req)
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.