|
|||||||||
| Home >> All >> org >> enhydra >> servlet >> [ filter overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.enhydra.servlet.filter
Class RequestFilter

java.lang.Objectorg.enhydra.servlet.filter.RequestFilter
- All Implemented Interfaces:
- javax.servlet.http.HttpServletRequest, org.apache.tomcat.core.RequestAdapter, javax.servlet.ServletRequest
- Direct Known Subclasses:
- PrintTransactionRequest
- public class RequestFilter
- extends java.lang.Object
- implements javax.servlet.http.HttpServletRequest, org.apache.tomcat.core.RequestAdapter
- extends java.lang.Object
This replaces the BasicTransactionRequest. This is part of the basic transaction filter. This is what wraps around the servlet request object. This class does nothing, every single call is a pass-through to the real request. This class exists so that it can be extended. You would then only need to override the methods you are interested in. All the other calls will be passed through by this class.
| Field Summary | |
protected org.apache.tomcat.core.RequestAdapter |
adapter
The RequestAdapter used by Tomcat. |
protected javax.servlet.http.HttpServletRequest |
myRequest
The original request. |
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
RequestFilter(javax.servlet.http.HttpServletRequest originalRequest)
Constructor. |
|
| Method Summary | |
int |
doRead()
|
int |
doRead(byte[] b,
int off,
int len)
Fill in the buffer. |
java.lang.Object |
getAttribute(java.lang.String name)
This call is passed on to the original HttpServletRequest object. |
java.util.Enumeration |
getAttributeNames()
Returns an Enumeration containing the
names of the attributes available to this request. |
java.lang.String |
getAuthType()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getCharacterEncoding()
This call is passed on to the original HttpServletRequest object. |
int |
getContentLength()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getContentType()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getContextPath()
Returns the portion of the request URI that indicates the context of the request. |
java.lang.String[] |
getCookieHeaders()
Return the cookies |
javax.servlet.http.Cookie[] |
getCookies()
This call is passed on to the original HttpServletRequest object. |
long |
getDateHeader(java.lang.String name)
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getHeader(java.lang.String name)
This call is passed on to the original HttpServletRequest object. |
java.util.Enumeration |
getHeaderNames()
This call is passed on to the original HttpServletRequest object. |
java.util.Enumeration |
getHeaders(java.lang.String name)
Returns all the values of the specified request header as an Enumeration of String objects. |
javax.servlet.ServletInputStream |
getInputStream()
This call is passed on to the original HttpServletRequest object. |
int |
getIntHeader(java.lang.String name)
This call is passed on to the original HttpServletRequest object. |
java.util.Locale |
getLocale()
Returns the preferred Locale that the client will
accept content in, based on the Accept-Language header. |
java.util.Enumeration |
getLocales()
Returns an Enumeration of Locale objects
indicating, in decreasing order starting with the preferred locale, the
locales that are acceptable to the client based on the Accept-Language
header. |
java.lang.String |
getMethod()
This call is passed on to the original HttpServletRequest object. |
org.apache.tomcat.util.MimeHeaders |
getMimeHeaders()
|
java.lang.String |
getParameter(java.lang.String name)
This call is passed on to the original HttpServletRequest object. |
java.util.Enumeration |
getParameterNames()
This call is passed on to the original HttpServletRequest object. |
java.lang.String[] |
getParameterValues(java.lang.String name)
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getPathInfo()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getPathTranslated()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getProtocol()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getQueryString()
This call is passed on to the original HttpServletRequest object. |
java.io.BufferedReader |
getReader()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getRealPath(java.lang.String path)
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getRemoteAddr()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getRemoteHost()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getRemoteUser()
This call is passed on to the original HttpServletRequest object. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String name)
Returns a javax.servlet.RequestDispatcher object that acts as a wrapper for the resource located at the given path. |
java.lang.String |
getRequestedSessionId()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getRequestURI()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getScheme()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getServerName()
This call is passed on to the original HttpServletRequest object. |
int |
getServerPort()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getServletName()
|
java.lang.String |
getServletPath()
This call is passed on to the original HttpServletRequest object. |
java.lang.String |
getServletPrefix()
|
javax.servlet.http.HttpSession |
getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one. |
javax.servlet.http.HttpSession |
getSession(boolean create)
This call is passed on to the original HttpServletRequest object. |
java.security.Principal |
getUserPrincipal()
Returns a java.security.Principal object containing
the name of the current authenticated user. |
boolean |
isRequestedSessionIdFromCookie()
This call is passed on to the original HttpServletRequest object. |
boolean |
isRequestedSessionIdFromUrl()
This call is passed on to the original HttpServletRequest object. |
boolean |
isRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL. |
boolean |
isRequestedSessionIdValid()
This call is passed on to the original HttpServletRequest object. |
boolean |
isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS. |
boolean |
isUserInRole(java.lang.String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". |
void |
recycle()
|
void |
removeAttribute(java.lang.String name)
Removes an attribute from this request. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Stores an attribute in this request. |
void |
setQueryString(java.lang.String queryString)
This call is passed on to the original HttpServletRequest object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.http.HttpServletRequest |
getRequestURL |
| Methods inherited from interface javax.servlet.ServletRequest |
getLocalAddr, getLocalName, getLocalPort, getParameterMap, getRemotePort, setCharacterEncoding |
| Field Detail |
myRequest
protected javax.servlet.http.HttpServletRequest myRequest
- The original request. All calls will be passed through to
this object. It is set by the constructor.
adapter
protected org.apache.tomcat.core.RequestAdapter adapter
- The RequestAdapter used by Tomcat.
| Constructor Detail |
RequestFilter
public RequestFilter(javax.servlet.http.HttpServletRequest originalRequest)
- Constructor. You must pass in the original request. All the
HttpServletRequest calls will be passed on to this object.
| Method Detail |
getContentLength
public int getContentLength()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getContentLengthin interfacejavax.servlet.ServletRequest
getContentType
public java.lang.String getContentType()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getContentTypein interfacejavax.servlet.ServletRequest
getProtocol
public java.lang.String getProtocol()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getProtocolin interfacejavax.servlet.ServletRequest
getScheme
public java.lang.String getScheme()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getSchemein interfacejavax.servlet.ServletRequest
getServerName
public java.lang.String getServerName()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getServerNamein interfacejavax.servlet.ServletRequest
getServerPort
public int getServerPort()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getServerPortin interfacejavax.servlet.ServletRequest
getRemoteAddr
public java.lang.String getRemoteAddr()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getRemoteAddrin interfacejavax.servlet.ServletRequest
getRemoteHost
public java.lang.String getRemoteHost()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getRemoteHostin interfacejavax.servlet.ServletRequest
getRealPath
public java.lang.String getRealPath(java.lang.String path)
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getRealPathin interfacejavax.servlet.ServletRequest
getInputStream
public javax.servlet.ServletInputStream getInputStream() throws java.io.IOException
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getInputStreamin interfacejavax.servlet.ServletRequest
getParameter
public java.lang.String getParameter(java.lang.String name)
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getParameterin interfacejavax.servlet.ServletRequest
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getParameterValuesin interfacejavax.servlet.ServletRequest
getParameterNames
public java.util.Enumeration getParameterNames()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getParameterNamesin interfacejavax.servlet.ServletRequest
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the ServletRequest
documentation.
- Specified by:
getAttributein interfacejavax.servlet.ServletRequest
getMethod
public java.lang.String getMethod()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getMethodin interfacejavax.servlet.http.HttpServletRequest
getRequestURI
public java.lang.String getRequestURI()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getRequestURIin interfacejavax.servlet.http.HttpServletRequest
getServletPath
public java.lang.String getServletPath()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getServletPathin interfacejavax.servlet.http.HttpServletRequest
getPathInfo
public java.lang.String getPathInfo()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getPathInfoin interfacejavax.servlet.http.HttpServletRequest
getPathTranslated
public java.lang.String getPathTranslated()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getPathTranslatedin interfacejavax.servlet.http.HttpServletRequest
getQueryString
public java.lang.String getQueryString()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getQueryStringin interfacejavax.servlet.http.HttpServletRequest
setQueryString
public void setQueryString(java.lang.String queryString)
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
setQueryStringin interfaceorg.apache.tomcat.core.RequestAdapter
getRemoteUser
public java.lang.String getRemoteUser()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getRemoteUserin interfacejavax.servlet.http.HttpServletRequest
getAuthType
public java.lang.String getAuthType()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getAuthTypein interfacejavax.servlet.http.HttpServletRequest
getHeader
public java.lang.String getHeader(java.lang.String name)
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getHeaderin interfacejavax.servlet.http.HttpServletRequest
getIntHeader
public int getIntHeader(java.lang.String name)
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getIntHeaderin interfacejavax.servlet.http.HttpServletRequest
getDateHeader
public long getDateHeader(java.lang.String name)
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getDateHeaderin interfacejavax.servlet.http.HttpServletRequest
getHeaderNames
public java.util.Enumeration getHeaderNames()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getHeaderNamesin interfacejavax.servlet.http.HttpServletRequest
getCookies
public javax.servlet.http.Cookie[] getCookies()
- This call is passed on to the original HttpServletRequest object.
- Specified by:
getCookiesin interfacejavax.servlet.http.HttpServletRequest
getSession
public javax.servlet.http.HttpSession getSession(boolean create)
- This call is passed on to the original HttpServletRequest object.
- Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
getRequestedSessionId
public java.lang.String getRequestedSessionId()
- This call is passed on to the original HttpServletRequest object.
For a description of what this call does, see the HttpServletRequest
documentation.
- Specified by:
getRequestedSessionIdin interfacejavax.servlet.http.HttpServletRequest
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()
- This call is passed on to the original HttpServletRequest object.
- Specified by:
isRequestedSessionIdValidin interfacejavax.servlet.http.HttpServletRequest
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()
- This call is passed on to the original HttpServletRequest object.
- Specified by:
isRequestedSessionIdFromCookiein interfacejavax.servlet.http.HttpServletRequest
isRequestedSessionIdFromUrl
public boolean isRequestedSessionIdFromUrl()
- This call is passed on to the original HttpServletRequest object.
- Specified by:
isRequestedSessionIdFromUrlin interfacejavax.servlet.http.HttpServletRequest
getReader
public java.io.BufferedReader getReader() throws java.io.IOException
- This call is passed on to the original HttpServletRequest object.
- Specified by:
getReaderin interfacejavax.servlet.ServletRequest
getCharacterEncoding
public java.lang.String getCharacterEncoding()
- This call is passed on to the original HttpServletRequest object.
- Specified by:
getCharacterEncodingin interfacejavax.servlet.ServletRequest
isUserInRole
public boolean isUserInRole(java.lang.String role)
- Description copied from interface:
javax.servlet.http.HttpServletRequest - Returns a boolean indicating whether the authenticated user is included
in the specified logical "role". Roles and role membership can be
defined using deployment descriptors. If the user has not been
authenticated, the method returns
false.- Specified by:
isUserInRolein interfacejavax.servlet.http.HttpServletRequest
getLocale
public java.util.Locale getLocale()
- Description copied from interface:
javax.servlet.ServletRequest - Returns the preferred
Localethat the client will accept content in, based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns the default locale for the server.- Specified by:
getLocalein interfacejavax.servlet.ServletRequest
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Description copied from interface:
javax.servlet.http.HttpServletRequest - Returns a
java.security.Principalobject containing the name of the current authenticated user. If the user has not been authenticated, the method returnsnull.- Specified by:
getUserPrincipalin interfacejavax.servlet.http.HttpServletRequest
getLocales
public java.util.Enumeration getLocales()
- Description copied from interface:
javax.servlet.ServletRequest - Returns an
EnumerationofLocaleobjects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns anEnumerationcontaining oneLocale, the default locale for the server.- Specified by:
getLocalesin interfacejavax.servlet.ServletRequest
getContextPath
public java.lang.String getContextPath()
- Description copied from interface:
javax.servlet.http.HttpServletRequest - Returns the portion of the request URI that indicates the context
of the request. The context path always comes first in a request
URI. The path starts with a "/" character but does not end with a "/"
character. For servlets in the default (root) context, this method
returns "". The container does not decode this string.
- Specified by:
getContextPathin interfacejavax.servlet.http.HttpServletRequest
getHeaders
public java.util.Enumeration getHeaders(java.lang.String name)
- Description copied from interface:
javax.servlet.http.HttpServletRequest - Returns all the values of the specified request header
as an
EnumerationofStringobjects.Some headers, such as
Accept-Languagecan be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.If the request did not include any headers of the specified name, this method returns an empty
Enumeration. The header name is case insensitive. You can use this method with any request header.- Specified by:
getHeadersin interfacejavax.servlet.http.HttpServletRequest
removeAttribute
public void removeAttribute(java.lang.String name)
- Description copied from interface:
javax.servlet.ServletRequest - Removes an attribute from this request. This method is not
generally needed as attributes only persist as long as the request
is being handled.
Attribute names should follow the same conventions as package names. Names beginning with
java.*,javax.*, andcom.sun.*, are reserved for use by Sun Microsystems.- Specified by:
removeAttributein interfacejavax.servlet.ServletRequest
isSecure
public boolean isSecure()
- Description copied from interface:
javax.servlet.ServletRequest - Returns a boolean indicating whether this request was made using a
secure channel, such as HTTPS.
- Specified by:
isSecurein interfacejavax.servlet.ServletRequest
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()
- Description copied from interface:
javax.servlet.http.HttpServletRequest - Checks whether the requested session ID came in as part of the
request URL.
- Specified by:
isRequestedSessionIdFromURLin interfacejavax.servlet.http.HttpServletRequest
getSession
public javax.servlet.http.HttpSession getSession()
- Description copied from interface:
javax.servlet.http.HttpServletRequest - Returns the current session associated with this request,
or if the request does not have a session, creates one.
- Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
getAttributeNames
public java.util.Enumeration getAttributeNames()
- Description copied from interface:
javax.servlet.ServletRequest - Returns an
Enumerationcontaining the names of the attributes available to this request. This method returns an emptyEnumerationif the request has no attributes available to it.- Specified by:
getAttributeNamesin interfacejavax.servlet.ServletRequest
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
- Description copied from interface:
javax.servlet.ServletRequest - Stores an attribute in this request.
Attributes are reset between requests. This method is most
often used in conjunction with javax.servlet.RequestDispatcher.
Attribute names should follow the same conventions as package names. Names beginning with
java.*,javax.*, andcom.sun.*, are reserved for use by Sun Microsystems.
If the object passed in is null, the effect is the same as calling ServletRequest.removeAttribute(java.lang.String)>ServletRequest.removeAttribute(java.lang.String)55 .
It is warned that when the request is dispatched from the servlet resides in a different web application byRequestDispatcher, the object set by this method may not be correctly retrieved in the caller servlet.- Specified by:
setAttributein interfacejavax.servlet.ServletRequest
getRequestDispatcher
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String name)
- Description copied from interface:
javax.servlet.ServletRequest - Returns a javax.servlet.RequestDispatcher object that acts as a wrapper for
the resource located at the given path.
A
RequestDispatcherobject can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root. This method returns
nullif the servlet container cannot return aRequestDispatcher.The difference between this method and ServletContext.getRequestDispatcher(java.lang.String)>
ServletContext.getRequestDispatcher(java.lang.String)55 is that this method can take a relative path.- Specified by:
getRequestDispatcherin interfacejavax.servlet.ServletRequest
recycle
public void recycle()
- Specified by:
recyclein interfaceorg.apache.tomcat.core.RequestAdapter
getMimeHeaders
public org.apache.tomcat.util.MimeHeaders getMimeHeaders()
- Specified by:
getMimeHeadersin interfaceorg.apache.tomcat.core.RequestAdapter
getCookieHeaders
public java.lang.String[] getCookieHeaders()
- Description copied from interface:
org.apache.tomcat.core.RequestAdapter - Return the cookies
- Specified by:
getCookieHeadersin interfaceorg.apache.tomcat.core.RequestAdapter
getServletPrefix
public java.lang.String getServletPrefix()
- Specified by:
getServletPrefixin interfaceorg.apache.tomcat.core.RequestAdapter
getServletName
public java.lang.String getServletName()
- Specified by:
getServletNamein interfaceorg.apache.tomcat.core.RequestAdapter
doRead
public int doRead()
throws java.io.IOException
- Specified by:
doReadin interfaceorg.apache.tomcat.core.RequestAdapter
doRead
public int doRead(byte[] b,
int off,
int len)
throws java.io.IOException
- Description copied from interface:
org.apache.tomcat.core.RequestAdapter - Fill in the buffer. This method is probably easier to implement than
previous.
This method should only be called from SerlvetInputStream implementations.
No need to implement it if your adapter implements ServletInputStream.
- Specified by:
doReadin interfaceorg.apache.tomcat.core.RequestAdapter
|
|||||||||
| Home >> All >> org >> enhydra >> servlet >> [ filter overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.enhydra.servlet.filter.RequestFilter