xecure.servlet
Class XecureHttpServletRequest

java.lang.Object
  extended byxecure.servlet.XecureHttpServletRequest
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

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

ÀÌ Å¬·¡½º´Â HttpServletRequest Interface ¸¦ ±¸ÇöÇÑ Å¬·¡½ºÀÌ´Ù. XecureWebÀ» Àû¿ëÇÑ ¼­ºí¸´¿¡ doPost, doGet ÇÔ¼öÀÇ ÆÄ¶ó¹ÌÅÍ·Î Àü´ÞµÇ¸ç, Ŭ¶óÀÌ¾ðÆ®·Î ºÎÅÍ Àü´ÞµÈ ¾ÏȣȭµÈ form µ¥ÀÌŸ¸¦ º¹È£È­ ÇÏ¿© ¸®ÅϽÃÄÑÁØ´Ù. °¢ ÇÔ¼öµéÀº HttpServletRequest Interface ¿¡ Á¤ÀÇµÈ ¿ªÇÒÀ» ¸ðµÎ ¼öÇàÇÑ´Ù.


Field Summary
 javax.servlet.http.HttpServletRequest req
          ¼­ºí¸´ ¿£ÁøÀ¸·Î ºÎÅÍ Àü´Þ¹ÞÀº HttpServletRequest Object
 
Constructor Summary
XecureHttpServletRequest(XecureSession xecureSession, javax.servlet.http.HttpServletRequest req)
          XecureHttpServletRequest Constructor
 
Method Summary
 java.lang.Object getAttribute(java.lang.String param)
          Returns the value of the named attribute of the request, or null if the attribute does not exist.
 java.util.Enumeration getAttributeNames()
           
 java.lang.String getAuthType()
          Gets the authentication scheme of this request.
 java.lang.String getCharacterEncoding()
          Returns the character set encoding for the input of this request.
 int getContentLength()
          Returns the size of the request entity data, or -1 if not known.
 java.lang.String getContentType()
          Returns the Internet Media Type of the request entity data, or null if not known.
 javax.servlet.http.Cookie[] getCookies()
          Gets the array of cookies found in this request.
 long getDateHeader(java.lang.String name)
          Gets the value of the requested date header field of this request.
 java.lang.String getHeader(java.lang.String name)
          Gets the value of the requested header field of this request.
 java.util.Enumeration getHeaderNames()
          Gets the header names for this request.
 javax.servlet.ServletInputStream getInputStream()
          Returns an input stream for reading binary data in the request body.
 int getIntHeader(java.lang.String name)
          Gets the value of the specified integer header field of this request.
 java.lang.String getMethod()
          Gets the HTTP method (for example, GET, POST, PUT) with which this request was made.
 java.lang.String getParameter(java.lang.String name)
          Returns a string containing the lone value of the specified parameter, or null if the parameter does not exist.
 java.util.Enumeration getParameterNames()
          º¹È£È­µÈ ParameterÀÇ nameµéÀ» ¾ò¾î¿Â´Ù.
 java.lang.String getParameterValue(java.lang.String name)
          º¹È£È­µÈ Parameter °ªÀ» ¾ò¾î¿Â´Ù.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns the values of the specified parameter for the request as an array of strings, or null if the named parameter does not exist.
 java.lang.String getPathInfo()
          Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string.
 java.lang.String getPathTranslated()
          Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string, and translates it to a real path.
 java.lang.String getProtocol()
          Returns the protocol and version of the request as a string of the form <protocol>/<major version>.
 java.lang.String getQueryString()
          Gets any query string that is part of the HTTP request URI.
 java.io.BufferedReader getReader()
          Returns a buffered reader for reading text in the request body.
 java.lang.String getRealPath(java.lang.String param)
          Applies alias rules to the specified virtual path and returns the corresponding real path, or null if the translation can not be performed for any reason.
 java.lang.String getRemoteAddr()
          Returns the IP address of the agent that sent the request.
 java.lang.String getRemoteHost()
          Returns the fully qualified host name of the agent that sent the request.
 java.lang.String getRemoteUser()
          Gets the name of the user making this request.
 java.lang.String getRequestedSessionId()
          Gets the session id specified with this request.
 java.lang.String getRequestURI()
          Gets, from the first line of the HTTP request, the part of this request's URI that is to the left of any query string.
 java.lang.String getScheme()
          Returns the scheme of the URL used in 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()
          Gets the part of this request's URI that refers to the servlet being invoked.
 javax.servlet.http.HttpSession getSession()
           
 javax.servlet.http.HttpSession getSession(boolean create)
          Gets the current valid session associated with this request, if create is false or, if necessary, creates a new session for the request, if create is true.
 int getXecureAuthType()
          ÇöÀç ¼¼¼ÇÀÇ ÀÎÁõ¹æ½ÄÀ» ¸®ÅÏÇÑ´Ù. 0 : ÀÍ¸í ¿¬°á, 1 : ÀÎÁõ¼­ ±â¹Ý ¿¬°á
 XecureSession getXecureSession()
          ÇöÀç ¼¼¼ÇÀÇ XecureSession object reference ¸¦ ¸®ÅÏÇÑ´Ù.
 java.lang.String getXecureSessionId()
          ÇöÀç ¼¼¼ÇÀÇ ¼¼¼Ç ID ¸¦ ¸®ÅÏÇÑ´Ù.
 Certificate getXecureUserCert()
          »ç¿ëÀÚ ÀÎÁõ¼­ ±â¹Ý SSL ¼¼¼ÇÀÌ ÀÌ·ç¾î Á³À» °æ¿ì ÀÎÁõµÈ »ç¿ëÀÚÀÇ Certificate object ¸¦ ¸®ÅÏÇÑ´Ù.
 java.lang.String getXecureUserId()
          ÇöÀç ¼¼¼ÇÀÇ »ç¿ëÀÚ ¾ÆÀ̵𸦠¸®ÅÏÇÑ´Ù.
 boolean isRequestedSessionIdFromCookie()
          Checks whether the session id specified by this request came in as a cookie.
 boolean isRequestedSessionIdFromUrl()
          Checks whether the session id specified by this request came in as part of the URL.
 boolean isRequestedSessionIdFromURL()
           
 boolean isRequestedSessionIdValid()
          Checks whether this request is associated with a session that is valid in the current session context.
 void setAttribute(java.lang.String key, java.lang.Object o)
          NEW Added Method 99.10.22
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

req

public javax.servlet.http.HttpServletRequest req
¼­ºí¸´ ¿£ÁøÀ¸·Î ºÎÅÍ Àü´Þ¹ÞÀº HttpServletRequest Object

Constructor Detail

XecureHttpServletRequest

public XecureHttpServletRequest(XecureSession xecureSession,
                                javax.servlet.http.HttpServletRequest req)
XecureHttpServletRequest Constructor

Parameters:
xecureSession - XecureSession object
req - ¼­ºí¸´ ¿£ÁøÀ¸·Î ºÎÅÍ Àü´ÞµÈ HttpServletRequest object
Method Detail

getParameterValue

public java.lang.String getParameterValue(java.lang.String name)
º¹È£È­µÈ Parameter °ªÀ» ¾ò¾î¿Â´Ù.

Parameters:
name - Parameter name

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns a string containing the lone value of the specified parameter, or null if the parameter does not exist. For example, in an HTTP servlet this method would return the value of the specified query string parameter. Servlet writers should use this method only when they are sure that there is only one value for the parameter. If the parameter has (or could have) multiple values, servlet writers should use getParameterValues. If a multiple valued parameter name is passed as an argument, the return value is implementation dependent. ¾ÏȣȭµÈ form µ¥ÀÌŸ¸¦ º¹È£È­µÈ µ¥ÀÌŸ·Î ¾ò¾î¿À¸ç, ¾Ïȣȭ µÇÁö ¾ÊÀº µ¥ÀÌŸµµ ¾ÏȣȭµÈ µ¥ÀÌŸ¿Í ¸¶Âù°¡Áö·Î ¾òÀ» ¼ö ÀÖ´Ù.

Specified by:
getParameter in interface javax.servlet.ServletRequest
Parameters:
name - the name of the parameter whose value is required.
See Also:
getParameterValues(java.lang.String)

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Returns the values of the specified parameter for the request as an array of strings, or null if the named parameter does not exist. For example, in an HTTP servlet this method would return the values of the specified query string or posted form as an array of strings.

Specified by:
getParameterValues in interface javax.servlet.ServletRequest
Parameters:
name - the name of the parameter whose value is required.
See Also:
ServletRequest.getParameter(java.lang.String)

getParameterNames

public java.util.Enumeration getParameterNames()
º¹È£È­µÈ ParameterÀÇ nameµéÀ» ¾ò¾î¿Â´Ù.

Specified by:
getParameterNames in interface javax.servlet.ServletRequest

getQueryString

public java.lang.String getQueryString()
Gets any query string that is part of the HTTP request URI. Same as the CGI variable QUERY_STRING.

Specified by:
getQueryString in interface javax.servlet.http.HttpServletRequest
Returns:
query string that is part of this request's URI, or null if it contains no query string

getContentLength

public int getContentLength()
Returns the size of the request entity data, or -1 if not known. Same as the CGI variable CONTENT_LENGTH.

Specified by:
getContentLength in interface javax.servlet.ServletRequest

getXecureUserCert

public Certificate getXecureUserCert()
»ç¿ëÀÚ ÀÎÁõ¼­ ±â¹Ý SSL ¼¼¼ÇÀÌ ÀÌ·ç¾î Á³À» °æ¿ì ÀÎÁõµÈ »ç¿ëÀÚÀÇ Certificate object ¸¦ ¸®ÅÏÇÑ´Ù. Certificate Object ¸¦ ÅëÇØ¼­ ÀÎÁõ¼­¿¡ Æ÷ÇԵǾî ÀÖ´Â Á¤º¸µéÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.

Returns:
Certificate
See Also:
Certificate

getXecureUserId

public java.lang.String getXecureUserId()
ÇöÀç ¼¼¼ÇÀÇ »ç¿ëÀÚ ¾ÆÀ̵𸦠¸®ÅÏÇÑ´Ù.

Returns:
userid

getXecureSessionId

public java.lang.String getXecureSessionId()
ÇöÀç ¼¼¼ÇÀÇ ¼¼¼Ç ID ¸¦ ¸®ÅÏÇÑ´Ù.

Returns:
session id

getXecureAuthType

public int getXecureAuthType()
ÇöÀç ¼¼¼ÇÀÇ ÀÎÁõ¹æ½ÄÀ» ¸®ÅÏÇÑ´Ù. 0 : ÀÍ¸í ¿¬°á, 1 : ÀÎÁõ¼­ ±â¹Ý ¿¬°á

Returns:
auth type

getXecureSession

public XecureSession getXecureSession()
ÇöÀç ¼¼¼ÇÀÇ XecureSession object reference ¸¦ ¸®ÅÏÇÑ´Ù.

Returns:
XecureSession object reference

getCookies

public javax.servlet.http.Cookie[] getCookies()
Gets the array of cookies found in this request.

Specified by:
getCookies in interface javax.servlet.http.HttpServletRequest
Returns:
the array of cookies found in this request

getMethod

public java.lang.String getMethod()
Gets the HTTP method (for example, GET, POST, PUT) with which this request was made. Same as the CGI variable REQUEST_METHOD.

Specified by:
getMethod in interface javax.servlet.http.HttpServletRequest
Returns:
the HTTP method with which this request was made

getRequestURI

public java.lang.String getRequestURI()
Gets, from the first line of the HTTP request, the part of this request's URI that is to the left of any query string. For example,
First line of HTTP request Return from getRequestURI
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 a URL with a URL scheme and host, use the method javax.servlet.http.HttpUtils.getRequestURL, which returns a StringBuffer.

Specified by:
getRequestURI in interface javax.servlet.http.HttpServletRequest
Returns:
this request's URI
See Also:
HttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest)

getServletPath

public java.lang.String getServletPath()
Gets the part of this request's URI that refers to the servlet being invoked. Analogous to the CGI variable SCRIPT_NAME.

Specified by:
getServletPath in interface javax.servlet.http.HttpServletRequest
Returns:
the servlet being invoked, as contained in this request's URI

getPathInfo

public java.lang.String getPathInfo()
Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string. Same as the CGI variable PATH_INFO.

Specified by:
getPathInfo in interface javax.servlet.http.HttpServletRequest
Returns:
the optional path information following the servlet path, but before the query string, in this request's URI; null if this request's URI contains no extra path information

getPathTranslated

public java.lang.String getPathTranslated()
Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string, and translates it to a real path. Similar to the CGI variable PATH_TRANSLATED

Specified by:
getPathTranslated in interface javax.servlet.http.HttpServletRequest
Returns:
extra path information translated to a real path or null if no extra path information is in the request's URI

getRemoteUser

public java.lang.String getRemoteUser()
Gets the name of the user making this request. The user name is set with HTTP authentication. Whether the user name will continue to be sent with each subsequent communication is browser-dependent. Same as the CGI variable REMOTE_USER.

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

getAuthType

public java.lang.String getAuthType()
Gets the authentication scheme of this request. Same as the CGI variable AUTH_TYPE.

Specified by:
getAuthType in interface javax.servlet.http.HttpServletRequest
Returns:
this request's authentication scheme, or null if none.

getHeader

public java.lang.String getHeader(java.lang.String name)
Gets the value of the requested header field of this request. The case of the header field name is ignored.

Specified by:
getHeader in interface javax.servlet.http.HttpServletRequest
Parameters:
name - the String containing the name of the requested header field
Returns:
the value of the requested header field, or null if not known.

getIntHeader

public int getIntHeader(java.lang.String name)
Gets the value of the specified integer header field of this request. The case of the header field name is ignored. If the header can't be converted to an integer, the method throws a NumberFormatException.

Specified by:
getIntHeader in interface javax.servlet.http.HttpServletRequest
Parameters:
name - the String containing the name of the requested header field
Returns:
the value of the requested header field, or -1 if not found.

getDateHeader

public long getDateHeader(java.lang.String name)
Gets the value of the requested date header field of this request. If the header can't be converted to a date, the method throws an IllegalArgumentException. The case of the header field name is ignored.

Specified by:
getDateHeader in interface javax.servlet.http.HttpServletRequest
Parameters:
name - the String containing the name of the requested header field
Returns:
the value the requested date header field, or -1 if not found.

getHeaderNames

public java.util.Enumeration getHeaderNames()
Gets the header names for this request.

Specified by:
getHeaderNames in interface javax.servlet.http.HttpServletRequest
Returns:
an enumeration of strings representing the header names for this request. Some server implementations do not allow headers to be accessed in this way, in which case this method will return null.

getSession

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

Note: to ensure the session is properly maintained, the servlet developer must call this method (at least once) before any output is written to the response.

Additionally, application-writers need to be aware that 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
Returns:
the session associated with this request or null if create was false and no valid session is associated with this request.

getRequestedSessionId

public java.lang.String getRequestedSessionId()
Gets the session id specified with this request. This may differ from the actual session id. For example, if the request specified an id for an invalid session, then this will get a new session with a new id.

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

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Checks whether this request is associated with a session that is valid in the current session context. If it is not valid, the requested session will never be returned from the getSession method.

Specified by:
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequest
Returns:
true if this request is assocated with a session that is valid in the current session context.
See Also:
getRequestedSessionId(), HttpSessionContext, getSession(boolean)

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()
Checks whether the session id specified by this request came in as a cookie. (The requested session may not be one returned by the getSession method.)

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

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()
Checks whether the session id specified by this request came in as part of the URL. (The requested session may not be the one returned by the getSession method.)

Specified by:
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequest
Returns:
true if the session id specified by the request for this session came in as part of the URL; false otherwise
See Also:
getSession(boolean)

getContentType

public java.lang.String getContentType()
Returns the Internet Media Type of the request entity data, or null if not known. Same as the CGI variable CONTENT_TYPE.

Specified by:
getContentType in interface javax.servlet.ServletRequest

getProtocol

public java.lang.String getProtocol()
Returns the protocol and version of the request as a string of the form <protocol>/<major version>.<minor version>. Same as the CGI variable SERVER_PROTOCOL.

Specified by:
getProtocol in interface javax.servlet.ServletRequest

getScheme

public java.lang.String getScheme()
Returns the scheme of the URL used in this request, for example "http", "https", or "ftp". Different schemes have different rules for constructing URLs, as noted in RFC 1738. The URL used to create a request may be reconstructed using this scheme, the server name and port, and additional information such as URIs.

Specified by:
getScheme in interface javax.servlet.ServletRequest

getServerName

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

Specified by:
getServerName in interface javax.servlet.ServletRequest

getServerPort

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

Specified by:
getServerPort in interface javax.servlet.ServletRequest

getRemoteAddr

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

Specified by:
getRemoteAddr in interface javax.servlet.ServletRequest

getRemoteHost

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

Specified by:
getRemoteHost in interface javax.servlet.ServletRequest

getRealPath

public java.lang.String getRealPath(java.lang.String param)
Applies alias rules to the specified virtual path and returns the corresponding real path, or null if the translation can not be performed for any reason. For example, an HTTP servlet would resolve the path using the virtual docroot, if virtual hosting is enabled, and with the default docroot otherwise. Calling this method with the string "/" as an argument returns the document root.

Specified by:
getRealPath in interface javax.servlet.ServletRequest

getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws java.io.IOException
Returns an input stream for reading binary data in the request body.

Specified by:
getInputStream in interface javax.servlet.ServletRequest
Throws:
java.lang.IllegalStateException - if getReader has been called on this same request.
java.io.IOException - on other I/O related errors.
See Also:
getReader

getAttribute

public java.lang.Object getAttribute(java.lang.String param)
Returns the value of the named attribute of the request, or null if the attribute does not exist. This method allows access to request information not already provided by the other methods in this interface. Attribute names should follow the same convention as package names.

Specified by:
getAttribute in interface javax.servlet.ServletRequest

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException
Returns a buffered reader for reading text in the request body. This translates character set encodings as appropriate.

Specified by:
getReader in interface javax.servlet.ServletRequest
Throws:
java.io.UnsupportedEncodingException - if the character set encoding is unsupported, so the text can't be correctly decoded.
java.lang.IllegalStateException - if getInputStream has been called on this same request.
java.io.IOException - on other I/O related errors.
See Also:
getInputStream

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Returns the character set encoding for the input of this request.

Specified by:
getCharacterEncoding in interface javax.servlet.ServletRequest

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object o)
NEW Added Method 99.10.22

Specified by:
setAttribute in interface javax.servlet.ServletRequest

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()
Specified by:
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequest

getAttributeNames

public java.util.Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface javax.servlet.ServletRequest

getSession

public javax.servlet.http.HttpSession getSession()
Specified by:
getSession in interface javax.servlet.http.HttpServletRequest