Package org.pac4j.jee.context
Class JEEContext
java.lang.Object
org.pac4j.jee.context.JEEContext
- All Implemented Interfaces:
org.pac4j.core.context.WebContext
This implementation uses the JEE
HttpServletRequest and HttpServletResponse.- Since:
- 1.4.0
- Author:
- Jerome Leleu
-
Constructor Summary
ConstructorsConstructorDescriptionJEEContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Build a JEE context from the current HTTP request and response. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResponseCookie(org.pac4j.core.context.Cookie cookie) javax.servlet.http.HttpServletRequestReturn the native HTTP request.javax.servlet.http.HttpServletResponseReturn the native HTTP response.getPath()This is not implemented usingHttpServletRequest.getServletPath()orHttpServletRequest.getPathInfo()because they both have strange behaviours in different contexts (inside servlets, inside filters, various container implementation, etc)getRequestAttribute(String name) Collection<org.pac4j.core.context.Cookie>getRequestHeader(String name) getRequestParameter(String name) getResponseHeader(String name) intbooleanisSecure()voidsetRequestAttribute(String name, Object value) voidsetResponseContentType(String content) voidsetResponseHeader(String name, String value)
-
Constructor Details
-
JEEContext
public JEEContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Build a JEE context from the current HTTP request and response.- Parameters:
request- the current requestresponse- the current response
-
-
Method Details
-
getRequestParameter
- Specified by:
getRequestParameterin interfaceorg.pac4j.core.context.WebContext
-
getRequestAttribute
- Specified by:
getRequestAttributein interfaceorg.pac4j.core.context.WebContext
-
setRequestAttribute
- Specified by:
setRequestAttributein interfaceorg.pac4j.core.context.WebContext
-
getRequestParameters
- Specified by:
getRequestParametersin interfaceorg.pac4j.core.context.WebContext
-
getRequestHeader
- Specified by:
getRequestHeaderin interfaceorg.pac4j.core.context.WebContext
-
getRequestMethod
- Specified by:
getRequestMethodin interfaceorg.pac4j.core.context.WebContext
-
getRemoteAddr
- Specified by:
getRemoteAddrin interfaceorg.pac4j.core.context.WebContext
-
getNativeRequest
public javax.servlet.http.HttpServletRequest getNativeRequest()Return the native HTTP request.- Returns:
- the native HTTP request
-
getNativeResponse
public javax.servlet.http.HttpServletResponse getNativeResponse()Return the native HTTP response.- Returns:
- the native HTTP response
-
setResponseHeader
- Specified by:
setResponseHeaderin interfaceorg.pac4j.core.context.WebContext
-
getResponseHeader
- Specified by:
getResponseHeaderin interfaceorg.pac4j.core.context.WebContext
-
setResponseContentType
- Specified by:
setResponseContentTypein interfaceorg.pac4j.core.context.WebContext
-
getServerName
- Specified by:
getServerNamein interfaceorg.pac4j.core.context.WebContext
-
getServerPort
public int getServerPort()- Specified by:
getServerPortin interfaceorg.pac4j.core.context.WebContext
-
getScheme
- Specified by:
getSchemein interfaceorg.pac4j.core.context.WebContext
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfaceorg.pac4j.core.context.WebContext
-
getRequestURL
- Specified by:
getRequestURLin interfaceorg.pac4j.core.context.WebContext
-
getFullRequestURL
- Specified by:
getFullRequestURLin interfaceorg.pac4j.core.context.WebContext
-
getRequestCookies
- Specified by:
getRequestCookiesin interfaceorg.pac4j.core.context.WebContext
-
addResponseCookie
public void addResponseCookie(org.pac4j.core.context.Cookie cookie) - Specified by:
addResponseCookiein interfaceorg.pac4j.core.context.WebContext
-
getPath
This is not implemented usingHttpServletRequest.getServletPath()orHttpServletRequest.getPathInfo()because they both have strange behaviours in different contexts (inside servlets, inside filters, various container implementation, etc)- Specified by:
getPathin interfaceorg.pac4j.core.context.WebContext
-
getRequestContent
- Specified by:
getRequestContentin interfaceorg.pac4j.core.context.WebContext
-
getProtocol
- Specified by:
getProtocolin interfaceorg.pac4j.core.context.WebContext
-