PAJES 3.0.21

org.pajes.servlet
Class HttpServletRequestWrapper

java.lang.Object
  extended by org.pajes.servlet.HttpServletRequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class HttpServletRequestWrapper
extends java.lang.Object
implements javax.servlet.http.HttpServletRequest

The HttpServletRequestWrapper object extends the standard HttpServletRequest object to provide additional functionality such as the ability to automatically process file uploads, and the handling of encrypted query parameters. Instances of HttpServletRequestWrapper are created by the static create(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, int) method.


Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Returns the value of the named attribute as an Object.
 java.util.Enumeration<?> getAttributeNames()
          Returns an Enumeration containing the names of the attributes available to this request.
 java.lang.String getAuthType()
          Returns the name of the authentication scheme the server uses, for example, "BASIC" or "SSL," or null if the server does not have an authentication scheme.
 java.lang.String getCharacterEncoding()
          Returns the name of the character encoding style used in this request.
 int getContentLength()
          Returns the length, in bytes, of the content contained in the request and sent by way of the input stream or -1 if the length is not known.
 java.lang.String getContentType()
          Returns the MIME type of the content of the request, or null if the type is not known.
 java.lang.String getContextPath()
          Returns the portion of the request URI that indicates the context of the request.
 javax.servlet.http.Cookie[] getCookies()
          Returns an array containing all of the Cookie objects the browser sent with this request.
 long getDateHeader(java.lang.String name)
          Returns the value of the specified request header as a long value that represents a Date object.
 java.lang.String getHeader(java.lang.String name)
          Returns the value of the specified request header as a String.
 java.util.Enumeration<?> getHeaderNames()
          Returns an enumeration of all the header names this request contains.
 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.http.HttpServletRequest getHttpServletRequest()
          Returns the HttpServletRequest that this object wrappers.
 javax.servlet.ServletInputStream getInputStream()
          Retrieves binary data from the body of the request as a ServletInputStream, which gives you the ability to read one line at a time.
 int getIntHeader(java.lang.String name)
          Returns the value of the specified request header as an integer.
 java.lang.String getLocalAddr()
          Returns the Internet Protocol (IP) address of the interface on which the request was received.
 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 getLocalName()
          Returns the host name of the Internet Protocol (IP) interface on which the request was received.
 int getLocalPort()
          Returns the Internet Protocol (IP) port number of the interface on which the request was received.
 java.lang.String getMethod()
          Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 java.lang.String getParameter(java.lang.String name)
          Returns the value of a request parameter as a String, or null if the parameter does not exist.
 java.util.Map<?,?> getParameterMap()
          Returns a java.util.Map of the parameters of this request.
 java.util.Enumeration<?> getParameterNames()
          Returns an Enumeration of String objects containing the names of the parameters contained in this request.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
 java.lang.String getPathInfo()
          Returns any extra path information associated with the URL the client sent when it made this request.
 java.lang.String getPathTranslated()
          Returns any extra path information after the servlet name but before the query string, and translates it to a real path.
 java.lang.String getProtocol()
          Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.
 java.lang.String getQueryString()
          Returns the query string that is contained in the request URL after the path.
 java.io.BufferedReader getReader()
          Returns the body of the request as a BufferedReader that translates character set encodings.
 java.lang.String getRealPath(java.lang.String path)
          Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath instead.
 java.lang.String getRemoteAddr()
          Returns the Internet Protocol (IP) address of the client that sent the request.
 java.lang.String getRemoteHost()
          Returns the fully qualified name of the client that sent the request.
 int getRemotePort()
          Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
 java.lang.String getRemoteUser()
          Returns the name of the user making this request, if the user has logged in using HTTP authentication.
 javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
          Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.
 java.lang.String getRequestedSessionId()
          Returns the session ID specified by the client.
 java.lang.String getRequestURI()
          Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
 java.lang.StringBuffer getRequestURL()
          Reconstructs the URL the client used to make the request.
 java.lang.String getScheme()
          Returns the name of the scheme used to make this request, for example, http, https, or ftp.
 java.lang.String getServerName()
          Returns the host name of the server that received the request.
 int getServerPort()
          Returns the port number on which this request was received.
 java.lang.String getServletPath()
          Returns the part of this request's URL that calls the servlet.
 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)
          Returns the current HttpSession associated with this request or, if necessary, creates a new session for the request.
 UploadedFile getUploadedFile(java.lang.String sourceFileName)
          Returns the specified uploaded file instance.
 java.util.Enumeration<java.lang.String> getUploadedFileNames()
          Returns an Enumeration of String objects containing the names of the files uploaded in this request.
 java.security.Principal getUserPrincipal()
          Returns a java.security.Principal object containing the name of the current authenticated user.
 boolean isRequestedSessionIdFromCookie()
          Checks whether the session ID this request submitted came in as a cookie, rather than from the getSession() method.
 boolean isRequestedSessionIdFromUrl()
          Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead.
 boolean isRequestedSessionIdFromURL()
          Checks whether the session ID this request submitted came in as part of the request URL, rather than from the getSession() method.
 boolean isRequestedSessionIdValid()
          Checks whether this request has a valid session in the current session context (which is a HttpSessionContext).
 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 removeAttribute(java.lang.String name)
          Removes an attribute from this request.
 void setAttribute(java.lang.String key, java.lang.Object o)
          Stores an attribute in the context of this request.
 void setCharacterEncoding(java.lang.String enc)
          Overrides the name of the character encoding used in the body of this request.
 void setUserPrincipal(java.security.Principal principal)
          Sets the authenticated user of this request.
 void setUserPrincipalRoles(PrincipalRoles roles)
          Sets valid roles for the authenticated user of this request.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Returns the value of the named attribute as an Object. This method allows the servlet engine to give the servlet custom information about a request. This method returns null if no attribute of the given name exists.

Attribute names should follow the same conventions as package names. This specification reserves names matching java., javax., and sun..

Specified by:
getAttribute in interface javax.servlet.ServletRequest
Parameters:
name - a String specifying the name of the attribute
Returns:
an Object containing the value of the attribute, or null if the attribute does not exist

getAttributeNames

public java.util.Enumeration<?> getAttributeNames()
Returns an Enumeration containing the names of the attributes available to this request. This method returns an empty Enumeration if the request has no attributes available to it.

Specified by:
getAttributeNames in interface javax.servlet.ServletRequest
Returns:
an Enumeration of strings containing the names of the request's attributes

getAuthType

public java.lang.String getAuthType()
Returns the name of the authentication scheme the server uses, for example, "BASIC" or "SSL," or null if the server does not have an authentication scheme.

The authentication scheme provides a challenge-response model in which the server challenges the client, and the client provides authentication information. Same as the value of the CGI variable AUTH_TYPE.

Specified by:
getAuthType in interface javax.servlet.http.HttpServletRequest
Returns:
a String specifying the name of the authentication scheme, or null if the server does not have an authentication scheme

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Returns the name of the character encoding style used in this request. This method returns null if the request does not use character encoding.

Specified by:
getCharacterEncoding in interface javax.servlet.ServletRequest
Returns:
a String containing the name of the chararacter encoding style, or null if the request does not use character encoding

getContentLength

public int getContentLength()
Returns the length, in bytes, of the content contained in the request and sent by way of the input stream or -1 if the length is not known. Same as the value of the CGI variable CONTENT_LENGTH.

Specified by:
getContentLength in interface javax.servlet.ServletRequest
Returns:
an integer containing the length of the content in the request or -1 if the length is not known

getContentType

public java.lang.String getContentType()
Returns the MIME type of the content of the request, or null if the type is not known. Same as the value of the CGI variable CONTENT_TYPE.

Specified by:
getContentType in interface javax.servlet.ServletRequest
Returns:
a String containing the name of the MIME type of the request, or -1 if the type is not known

getContextPath

public java.lang.String getContextPath()
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 "".

Specified by:
getContextPath in interface javax.servlet.http.HttpServletRequest
Returns:
a String specifying the portion of the request URI that indicates the context of the request

getCookies

public javax.servlet.http.Cookie[] getCookies()
Returns an array containing all of the Cookie objects the browser sent with this request. This method returns null if the browser did not send any cookies.

Specified by:
getCookies in interface javax.servlet.http.HttpServletRequest
Returns:
an array of all the Cookies included with this request, or null if the request has no cookies

getDateHeader

public long getDateHeader(java.lang.String name)
Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such as If-Modified-Since.

The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.

If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method returns an IllegalArgumentException.

Specified by:
getDateHeader in interface javax.servlet.http.HttpServletRequest
Parameters:
name - a String specifying the name of the header
Returns:
a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the reqest

getHeader

public java.lang.String getHeader(java.lang.String name)
Returns the value of the specified request header as a String. If the named header wasn't sent with the request, this method returns null. The header name is case insensitive. You can use this method with any request header.

Specified by:
getHeader in interface javax.servlet.http.HttpServletRequest
Parameters:
name - a String specifying the header name
Returns:
a String containing the value of the requested header, or null if the request does not have a header of that name

getHeaderNames

public java.util.Enumeration<?> getHeaderNames()
Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration.

Some servlet engines do not allow do not allow servlets to access headers using this method, in which case this method returns null

Specified by:
getHeaderNames in interface javax.servlet.http.HttpServletRequest
Returns:
an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the servlet engine does not allow servlets to use this method, null

getHeaders

public java.util.Enumeration<?> getHeaders(java.lang.String name)
Returns all the values of the specified request header as an Enumeration of String objects.

Some headers, such as Accept-Language can 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:
getHeaders in interface javax.servlet.http.HttpServletRequest
Parameters:
name - a String specifying the header name
Returns:
a Enumeration containing the values of the requested header, or null if the request does not have any headers of that name

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Returns the HttpServletRequest that this object wrappers.

Returns:
the wrappered HttpServletRequest instance.

getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws java.io.IOException
Retrieves binary data from the body of the request as a ServletInputStream, which gives you the ability to read one line at a time.

Specified by:
getInputStream in interface javax.servlet.ServletRequest
Returns:
a object containing the body of the request
Throws:
java.io.IOException - if an input or output exception occurred

getIntHeader

public int getIntHeader(java.lang.String name)
Returns the value of the specified request header as an integer. If the request does not have a header of the specified name, this method returns -1. If the header cannot be converted to an integer, this method throws a NumberFormatException.

The header name is case insensitive.

Specified by:
getIntHeader in interface javax.servlet.http.HttpServletRequest
Parameters:
name - a String specifying the name of a request header
Returns:
an integer expressing the value of the request header or -1 if the request doesn't have a header of this name

getLocalAddr

public java.lang.String getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received.

Specified by:
getLocalAddr in interface javax.servlet.ServletRequest
Returns:
a String containing the IP address on which the request was received.
Since:
2.4

getLocale

public java.util.Locale getLocale()
Returns the preferred Locale that 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:
getLocale in interface javax.servlet.ServletRequest
Returns:
the preferred Locale for the client

getLocales

public 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. If the client request doesn't provide an Accept-Language header, this method returns an Enumeration containing one Locale, the default locale for the server.

Specified by:
getLocales in interface javax.servlet.ServletRequest
Returns:
an Enumeration of preferred Locale objects for the client

getLocalName

public java.lang.String getLocalName()
Returns the host name of the Internet Protocol (IP) interface on which the request was received.

Specified by:
getLocalName in interface javax.servlet.ServletRequest
Returns:
a String containing the host name of the IP on which the request was received.
Since:
2.4

getLocalPort

public int getLocalPort()
Returns the Internet Protocol (IP) port number of the interface on which the request was received.

Specified by:
getLocalPort in interface javax.servlet.ServletRequest
Returns:
an integer specifying the port number
Since:
2.4

getMethod

public java.lang.String getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. The returned String is the same as the value of the CGI variable REQUEST_METHOD.

Specified by:
getMethod in interface javax.servlet.http.HttpServletRequest
Returns:
a String specifying the name of the method with which this request was made

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request.

You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues(java.lang.String).

If you use this method with a multivalued parameter, the servlet engine determines the return value.

Specified by:
getParameter in interface javax.servlet.ServletRequest
Parameters:
name - a String specifying the name of the parameter
Returns:
a String representing the single value of the parameter
See Also:
getParameterValues(java.lang.String)

getParameterMap

public java.util.Map<?,?> getParameterMap()
Returns a java.util.Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

Specified by:
getParameterMap in interface javax.servlet.ServletRequest
Returns:
an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
Since:
Servlet 2.3

getParameterNames

public java.util.Enumeration<?> getParameterNames()
Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters or if the input stream is empty, returns an empty Enumeration. The input stream is empty when all the data returned by getInputStream() has been read.

Specified by:
getParameterNames in interface javax.servlet.ServletRequest
Returns:
an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. For example, in an HTTP servlet, this method returns an array of String objects containing the values of a query string or posted form.

If the parameter has a single value, the array has a length of 1.

Specified by:
getParameterValues in interface javax.servlet.ServletRequest
Parameters:
name - a String containing the name of the parameter whose value is requested
Returns:
an array of String objects containing the parameter's values
See Also:
getParameter(java.lang.String)

getPathInfo

public java.lang.String getPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path (the URI of the URL) but precedes the query string. This method returns null if there was no extra path information.

The information this method returns is the same as the value of the CGI variable PATH_INFO.

Specified by:
getPathInfo in interface javax.servlet.http.HttpServletRequest
Returns:
a String specifying extra path information that comes after the servlet path but before the query string in the request URL; or null if the URL does not have any extra path information

getPathTranslated

public java.lang.String getPathTranslated()
Returns any extra path information after the servlet name but before the query string, and translates it to a real path. Same as the value of the CGI variable PATH_TRANSLATED.

If the URL does not have any extra path information, this method returns null.

Specified by:
getPathTranslated in interface javax.servlet.http.HttpServletRequest
Returns:
a String specifying the real path, or null if the URL does not have any extra path information

getProtocol

public java.lang.String getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. The value returned is the same as the value of the CGI variable SERVER_PROTOCOL.

Specified by:
getProtocol in interface javax.servlet.ServletRequest
Returns:
a String containing the protocol name and version number

getQueryString

public java.lang.String getQueryString()
Returns the query string that is contained in the request URL after the path. This method returns null if the URL does not have a query string. Same as the value of the CGI variable QUERY_STRING.

Specified by:
getQueryString in interface javax.servlet.http.HttpServletRequest
Returns:
a String containing the query string or null if the URL contains no query string

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException
Returns the body of the request as a BufferedReader that translates character set encodings.

Specified by:
getReader in interface javax.servlet.ServletRequest
Returns:
a BufferedReader containing the body of the request
Throws:
java.io.IOException - if an input or output exception occurred
See Also:
getInputStream()

getRealPath

@Deprecated
public java.lang.String getRealPath(java.lang.String path)
Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath instead.

Deprecated.

Specified by:
getRealPath in interface javax.servlet.ServletRequest
Parameters:
path - the context path.
Returns:
the real path.

getRemoteAddr

public java.lang.String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request. Same as the value of the CGI variable REMOTE_ADDR.

Specified by:
getRemoteAddr in interface javax.servlet.ServletRequest
Returns:
a String containing the IP address of the client that sent the request

getRemoteHost

public java.lang.String getRemoteHost()
Returns the fully qualified name of the client that sent the request. Same as the value of the CGI variable REMOTE_HOST.

Specified by:
getRemoteHost in interface javax.servlet.ServletRequest
Returns:
a String containing the fully qualified name of the client

getRemotePort

public int getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.

Specified by:
getRemotePort in interface javax.servlet.ServletRequest
Returns:
an integer specifying the port number
Since:
2.4

getRemoteUser

public java.lang.String getRemoteUser()
Returns the name of the user making this request, if the user has logged in using HTTP authentication. This method returns null if the user login is not authenticated. Whether the user name is sent with each subsequent request depends on the browser. Same as the value of the CGI variable REMOTE_USER.

Specified by:
getRemoteUser in interface javax.servlet.http.HttpServletRequest
Returns:
a String specifying the name of the user making this request, or null if the user name is not known

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object 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 null if the servlet container cannot return a RequestDispatcher.

The difference between this method and ServletContext.getRequestDispatcher(java.lang.String) is that this method can take a relative path.

Specified by:
getRequestDispatcher in interface javax.servlet.ServletRequest
Parameters:
path - a String specifying the pathname to the resource
Returns:
a RequestDispatcher object that acts as a wrapper for the resource at the specified path

getRequestedSessionId

public java.lang.String getRequestedSessionId()
Returns the session ID specified by the client. This may not be the same as the ID of the actual session in use. For example, if the request specified an old (expired) session ID and the server has started a new session, this method gets a new session with a new ID. If the request did not specify a session ID, this method returns null.

Specified by:
getRequestedSessionId in interface javax.servlet.http.HttpServletRequest
Returns:
a String specifying the session ID, or null if the request did not specify a session ID.
See Also:
isRequestedSessionIdValid()

getRequestURI

public java.lang.String getRequestURI()
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. For example:
First line of HTTP request Returned Value
POST /some/path.html HTTP/1.1 /some/path.html
GET http://foo.bar/a.html HTTP/1.0 http://foo.bar/a.html
HEAD /xyz?a=b HTTP/1.1 /xyz

To reconstruct an URL with a scheme and host, use HttpUtils.getRequestURL, which returns a StringBuilder.

Specified by:
getRequestURI in interface javax.servlet.http.HttpServletRequest
Returns:
a String containing the part of the URL from the protocol name up to the query string

getRequestURL

public java.lang.StringBuffer getRequestURL()
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.

Because this method returns a StringBuilder, not a string, you can modify the URL easily, for example, to append query parameters.

This method is useful for creating redirect messages and for reporting errors.

Specified by:
getRequestURL in interface javax.servlet.http.HttpServletRequest
Returns:
a StringBuilder object containing the reconstructed URL
Since:
Servlet 2.3

getScheme

public java.lang.String getScheme()
Returns the name of the scheme used to make this request, for example, http, https, or ftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.

You can reconstruct the URL used to make this request by using this scheme, the server name and port, the pathname to the Web page on the server (also known as the Universal Resource Identifier), and the query string..

Specified by:
getScheme in interface javax.servlet.ServletRequest
Returns:
a String containing the name of the scheme used to make this request

getServerName

public java.lang.String getServerName()
Returns the host name of the server that received the request. Same as the value of the CGI variable SERVER_NAME.

Specified by:
getServerName in interface javax.servlet.ServletRequest
Returns:
a String containing the name of the server to which the request was sent

getServerPort

public int getServerPort()
Returns the port number on which this request was received. Same as the value of the CGI variable SERVER_PORT.

Specified by:
getServerPort in interface javax.servlet.ServletRequest
Returns:
an integer specifying the port number

getServletPath

public java.lang.String getServletPath()
Returns the part of this request's URL that calls the servlet. This includes either the servlet name or a path to the servlet, but does not include any extra path information or a query string. Same as the value of the CGI variable SCRIPT_NAME.

Specified by:
getServletPath in interface javax.servlet.http.HttpServletRequest
Returns:
a String containing the name or path of the servlet being called, as it is specified in the request URL

getSession

public javax.servlet.http.HttpSession getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one.

Specified by:
getSession in interface javax.servlet.http.HttpServletRequest
Returns:
the HttpSession associated with this request

getSession

public javax.servlet.http.HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request or, if necessary, creates a new session for the request. Use true for create to create a new session, or false to return the current HttpSession.

If create is false and the request has no valid HttpSession, this method returns null.

To make sure the session is properly maintained, you must call this method at least once before you write any output to the response. Newly created sessions (that is, sessions for which HttpSession.isNew returns true) do not have any application-specific state.

Specified by:
getSession in interface javax.servlet.http.HttpServletRequest
Parameters:
create - true to create a new session for this request; false to return the current session
Returns:
the HttpSession associated with this request or null if create is false and the request has no valid session

getUploadedFile

public UploadedFile getUploadedFile(java.lang.String sourceFileName)
Returns the specified uploaded file instance.

Parameters:
sourceFileName - the file name of the uploaded file to be retrieved.
Returns:
the uploaded file definition.
See Also:
getUploadedFileNames()

getUploadedFileNames

public java.util.Enumeration<java.lang.String> getUploadedFileNames()
Returns an Enumeration of String objects containing the names of the files uploaded in this request. If the request has no uploaded files, returns an empty Enumeration.

Returns:
an Enumeration of String objects, each String containing the source file name of an uploaded file; or an empty Enumeration if the request has no uploaded files.
See Also:
getUploadedFile(java.lang.String)

getUserPrincipal

public java.security.Principal getUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user. If the user has not been authenticated, the method returns null.

Specified by:
getUserPrincipal in interface javax.servlet.http.HttpServletRequest
Returns:
a java.security.Principal containing the name of the user making this request; null if the user has not been authenticated

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()
Checks whether the session ID this request submitted came in as a cookie, rather than from the getSession() method.

Specified by:
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequest
Returns:
true if the session ID came in as a cookie; otherwise, false.
See Also:
getSession()

isRequestedSessionIdFromUrl

@Deprecated
public boolean isRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead.

Deprecated.

Specified by:
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequest
Returns:
true if the session ID came in as part of an URL; otherwise, false.

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()
Checks whether the session ID this request submitted came in as part of the request URL, rather than from the getSession() method.

Specified by:
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequest
Returns:
true if the session ID came in as part of an URL; otherwise, false.
See Also:
getSession()

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Checks whether this request has a valid session in the current session context (which is a HttpSessionContext). If the session is not valid, the getSession() method never returns it.

Specified by:
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequest
Returns:
true if this request has a valid session in the current session context; otherwise, false.
See Also:
getRequestedSessionId(), getSession()

isSecure

public boolean isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

Specified by:
isSecure in interface javax.servlet.ServletRequest
Returns:
a boolean indicating if the request was made using a secure channel

isUserInRole

public boolean isUserInRole(java.lang.String role)
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:
isUserInRole in interface javax.servlet.http.HttpServletRequest
Parameters:
role - a String specifying the name of the role
Returns:
a boolean indicating whether the user making this request belongs to a given role; false if the user has not been authenticated

removeAttribute

public void removeAttribute(java.lang.String name)
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., and com.sun., are reserved for use by Sun Microsystems.

Specified by:
removeAttribute in interface javax.servlet.ServletRequest
Parameters:
name - a String specifying the name of the attribute to remove

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object o)
Stores an attribute in the context of this request. Attributes are reset between requests.

Attribute names should follow the same conventions as package names. Names beginning with java., javax., and com.sun., are reserved for use by Sun Microsystems.

Specified by:
setAttribute in interface javax.servlet.ServletRequest
Parameters:
key - a String specifying the name of the attribute
o - an Object containing the context of the request

setCharacterEncoding

public void setCharacterEncoding(java.lang.String enc)
                          throws java.io.UnsupportedEncodingException
Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader().

Specified by:
setCharacterEncoding in interface javax.servlet.ServletRequest
Parameters:
enc - a String containing the name of the chararacter encoding.
Throws:
java.io.UnsupportedEncodingException - if this is not a valid encoding
Since:
Servlet 2.3

setUserPrincipal

public void setUserPrincipal(java.security.Principal principal)
Sets the authenticated user of this request.

Parameters:
principal - a java.security.Principal containing the name of the user making this request

setUserPrincipalRoles

public void setUserPrincipalRoles(PrincipalRoles roles)
Sets valid roles for the authenticated user of this request.

Parameters:
roles - a org.pajes.security.PrincipalRoles instance containing the valid roles for the user making this request;

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

PAJES 3.0.21

Copyright © 1998-2007 Viridian Pty Limited. All Rights Reserved.