public interface HttpContext
Use this interface rather than making static calls to classes like ServletActionContext directly.
Note that this interface makes no guarantees about which wrapper for the active request, response or session will be returned. Callers should not rely on retrieving any particular wrapper. It is only guaranteed to be populated on a http request thread, after login, and before decoration.
| Modifier and Type | Method and Description |
|---|---|
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the active HTTP request or
null if one cannot be found. |
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the active HTTP response or
null if one cannot be found. |
javax.servlet.http.HttpSession |
getSession(boolean create)
Returns the session associated with the active request or, if there is no current session and
create is true,
returns a new session. |
@Nullable javax.servlet.http.HttpServletRequest getRequest()
null if one cannot be found.@Nullable javax.servlet.http.HttpServletResponse getResponse()
null if one cannot be found.@Nullable javax.servlet.http.HttpSession getSession(boolean create)
create is true,
returns a new session.create - should be true to create a new session for the active request or false to return
null if there is no current sessionnull if create is false and the request has
no session, or if there is no active requestCopyright © 2019 Atlassian. All rights reserved.