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.booleangetParameterBoolean(String name, boolean theDefault) Get a boolean from the input.org.apache.commons.fileupload.FileItemgetParameterFileItem(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.HttpSessionjavax.servlet.http.HttpSessiongetSession(boolean create) voidinit()initbooleanif is multipart requestrequestParameterNamesByPrefix(String prefix) find the request parameter names by prefixstatic GrouperRequestWrapperretrieveGrouperRequestWrapper(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, upgradeMethods 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, startAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getRemoteAddrin interfacejavax.servlet.ServletRequest- Overrides:
getRemoteAddrin classjavax.servlet.ServletRequestWrapper
-
isMultipart
public boolean isMultipart()if is multipart request- Returns:
-
getAttribute
- Specified by:
getAttributein interfacejavax.servlet.ServletRequest- Overrides:
getAttributein 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:
getSessionin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getSessionin classjavax.servlet.http.HttpServletRequestWrapper- See Also:
-
HttpServletRequestWrapper.getSession()
-
getSession
public javax.servlet.http.HttpSession getSession(boolean create) - Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getSessionin 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:
getRequestURLin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getRequestURLin 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:
getParameterNamesin interfacejavax.servlet.ServletRequest- Overrides:
getParameterNamesin classjavax.servlet.ServletRequestWrapper- Returns:
- get parameter names passed in
-
getParameterValues
Return an array of strings for an input parameter- Specified by:
getParameterValuesin interfacejavax.servlet.ServletRequest- Overrides:
getParameterValuesin 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:
getHeaderin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getHeaderin classjavax.servlet.http.HttpServletRequestWrapper
-
owaspCsrfTokenHeader
-
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:
getParameterin interfacejavax.servlet.ServletRequest- Overrides:
getParameterin 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
-