Class GrouperRequestWrapper
java.lang.Object
javax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
edu.internet2.middleware.grouper.j2ee.GrouperRequestWrapper
- All Implemented Interfaces:
javax.servlet.http.HttpServletRequest
,javax.servlet.ServletRequest
public class GrouperRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper
wrap request so we can customize
-
Field Summary
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String name) param boolean for ELgetParameter
(String name) Use this instead of request.getParameter as it will handle file uploads.getParameterBoolean
(String name) Get a boolean from the input.boolean
getParameterBoolean
(String name, boolean theDefault) Get a boolean from the input.org.apache.commons.fileupload.FileItem
getParameterFileItem
(String name) get a param from file request as fileItemGet the parameter names from the fast requestString[]
getParameterValues
(String name) Return an array of strings for an input parameterproblem with tomcat and request wrappers, so stash this and get back later: http://brian.pontarelli.com/2008/01/16/httpservletrequestwrapper-tomcat-and-forwards/javax.servlet.http.HttpSession
javax.servlet.http.HttpSession
getSession
(boolean create) void
init()
initboolean
if is multipart requestrequestParameterNamesByPrefix
(String prefix) find the request parameter names by prefixstatic GrouperRequestWrapper
retrieveGrouperRequestWrapper
(javax.servlet.ServletRequest servletRequest) get the grouper request wrapperMethods inherited from class javax.servlet.http.HttpServletRequestWrapper
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getServletPath, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout, upgrade
Methods inherited from class javax.servlet.ServletRequestWrapper
getAsyncContext, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getProtocol, getReader, getRealPath, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.servlet.ServletRequest
getAsyncContext, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getProtocol, getReader, getRealPath, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
-
Constructor Details
-
GrouperRequestWrapper
public GrouperRequestWrapper(javax.servlet.http.HttpServletRequest request) - Parameters:
request
-
-
-
Method Details
-
retrieveGrouperRequestWrapper
public static GrouperRequestWrapper retrieveGrouperRequestWrapper(javax.servlet.ServletRequest servletRequest) get the grouper request wrapper- Returns:
-
getRemoteAddr
- Specified by:
getRemoteAddr
in interfacejavax.servlet.ServletRequest
- Overrides:
getRemoteAddr
in classjavax.servlet.ServletRequestWrapper
-
isMultipart
public boolean isMultipart()if is multipart request- Returns:
-
getAttribute
- Specified by:
getAttribute
in interfacejavax.servlet.ServletRequest
- Overrides:
getAttribute
in classjavax.servlet.ServletRequestWrapper
- See Also:
-
ServletRequestWrapper.getAttribute(java.lang.String)
-
getParameterFileItem
get a param from file request as fileItem- Parameters:
name
-- Returns:
- the param
-
init
public void init()init -
getSession
public javax.servlet.http.HttpSession getSession()- Specified by:
getSession
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getSession
in classjavax.servlet.http.HttpServletRequestWrapper
- See Also:
-
HttpServletRequestWrapper.getSession()
-
getSession
public javax.servlet.http.HttpSession getSession(boolean create) - Specified by:
getSession
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getSession
in classjavax.servlet.http.HttpServletRequestWrapper
- See Also:
-
HttpServletRequestWrapper.getSession(boolean)
-
getRequestURL
problem with tomcat and request wrappers, so stash this and get back later: http://brian.pontarelli.com/2008/01/16/httpservletrequestwrapper-tomcat-and-forwards/
- Specified by:
getRequestURL
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getRequestURL
in classjavax.servlet.http.HttpServletRequestWrapper
- See Also:
-
HttpServletRequestWrapper.getRequestURL()
-
requestParameterNamesByPrefix
find the request parameter names by prefix- Parameters:
prefix
-- Returns:
- the set, never null
-
getParameterNames
Get the parameter names from the fast request- Specified by:
getParameterNames
in interfacejavax.servlet.ServletRequest
- Overrides:
getParameterNames
in classjavax.servlet.ServletRequestWrapper
- Returns:
- get parameter names passed in
-
getParameterValues
Return an array of strings for an input parameter- Specified by:
getParameterValues
in interfacejavax.servlet.ServletRequest
- Overrides:
getParameterValues
in classjavax.servlet.ServletRequestWrapper
- Parameters:
name
-- Returns:
- parameter values based on name
-
getParameter
param boolean for EL- Returns:
- the boolean value of param
-
getHeader
- Specified by:
getHeader
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getHeader
in classjavax.servlet.http.HttpServletRequestWrapper
-
getParameter
Use this instead of request.getParameter as it will handle file uploads. If the parameter is in fast a file, this method will return the filepath. However, please do not call this method for files, please use getParameterFile(name).- Specified by:
getParameter
in interfacejavax.servlet.ServletRequest
- Overrides:
getParameter
in classjavax.servlet.ServletRequestWrapper
- Parameters:
name
-- Returns:
- get a certain param
-
getParameterBoolean
Get a boolean from the input. must be true or false or not existent. For expression language, just use getParameter as string- Parameters:
name
-- Returns:
- TRUE or FALSE or null
-
getParameterBoolean
Get a boolean from the input. mus tbe true or false or not existent.- Parameters:
name
-theDefault
- is what to return if param not there (usually false)- Returns:
- TRUE or FALSE or null
-