|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--rup.robot.httpserver.request.MyRequest
|
+--rup.robot.httpserver.request.MyServletRequest
Maintenant que l'on dispose des outils permettant de remplir la hashtable avec les tokens contenus dans le Header de la requete http, on peut implémenter l'interface ServletRequest fournit par Sun.
Il faut appeller à bonne escient la méthode hashtable.get(ATTRIBUT_QUI_NOUS_INTERESSE) ou alors si l'on veut toutes les attributs contenus dans la requete http, il suffit de faire hashtable.getKeys() etc ....
De maniere générale on utilise les méthodes de la class Hashtable pour avoir accés aux données qui nous intéressent.
Etant donné que l'on récupere les spécifiactions de Sun et que l'on respecte dans ce cas les commentaires des méthoes sont récupérées sur leurs spécifications
| Inner classes inherited from class rup.robot.httpserver.request.MyRequest |
MyRequest.JServInputStream |
| Fields inherited from class rup.robot.httpserver.request.MyRequest |
env_vars,
headers_in,
in,
params |
| Constructor Summary | |
MyServletRequest(java.io.InputStream in)
|
|
| Method Summary | |
java.lang.Object |
getAttribute(java.lang.String name)
PAS IMPLEMANTE Returns the value of the named attribute as an Object.
|
java.util.Enumeration |
getAttributeNames()
PAS IMPLEMENTE Returns an Enumeration containing the
names of the attributes available to this request.
|
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. |
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. |
java.lang.String |
getParameter(java.lang.String name)
PAS IMPLEMENTE Returns the value of a request parameter as a String,
or null if the parameter does not exist. |
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 |
getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. |
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. |
java.lang.String |
getScheme()
PAS IMPLEMENTE PAS IMPLEMENTE PAS IMPLEMENTE 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. |
static java.lang.String |
parseCharacterEncoding(java.lang.String contentType)
Methode provenant de Jserv Parse a content-type header for the character encoding. |
void |
setAttribute(java.lang.String key,
java.lang.Object o)
PAS IMPLEMENTE Stores an attribute in the context of this request. |
| Methods inherited from class rup.robot.httpserver.request.MyRequest |
getEnv,
getTokens,
readHeader |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public MyServletRequest(java.io.InputStream in)
throws java.io.IOException
| Method Detail |
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.*.
name - a String specifying the name of
the attributeObject containing the value
of the attribute, or null if
the attribute does not existpublic java.util.Enumeration getAttributeNames()
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.Enumeration of strings
containing the names
of the request's attributespublic java.lang.String getCharacterEncoding()
null if the request
does not use character encoding.String containing the name of
the chararacter encoding style, or null
if the request does not use character encodingpublic int getContentLength()
public java.lang.String getContentType()
null if the type is not known. Same as the value
of the CGI variable CONTENT_TYPE.String containing the name
of the MIME type of
the request, or -1 if the type is not known
public javax.servlet.ServletInputStream getInputStream()
throws java.io.IOException
ServletInputStream, which
gives you the ability to read one line at a time.ServletInputStream object containing
the body of the requestgetReader() method
has already been called for this requestpublic java.lang.String getParameter(java.lang.String name)
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.
name - a String specifying the
name of the parameterString representing the
single value of the parametergetParameterValues(java.lang.String)public java.util.Enumeration getParameterNames()
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.Enumeration of String
objects, each String containing
the name of a request parameter; or an
empty Enumeration if the
request has no parameterspublic java.lang.String[] getParameterValues(java.lang.String name)
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.
name - a String containing the name of
the parameter whose value is requestedString objects
containing the parameter's valuesgetParameter(java.lang.String)public java.lang.String getProtocol()
SERVER_PROTOCOL.String containing the protocol
name and version numberpublic java.lang.String getScheme()
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..
String containing the name
of the scheme used to make this requestpublic java.lang.String getServerName()
SERVER_NAME.String containing the name
of the server to which the request was sentpublic int getServerPort()
SERVER_PORT.
public java.io.BufferedReader getReader()
throws java.io.IOException
BufferedReader
that translates character set encodings.BufferedReader
containing the body of the requestgetInputStream() method
has been called on this requestgetInputStream()public java.lang.String getRemoteAddr()
REMOTE_ADDR.String containing the
IP address of the client that sent the requestpublic java.lang.String getRemoteHost()
REMOTE_HOST.String containing the fully qualified name
of the client
public void setAttribute(java.lang.String key,
java.lang.Object o)
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.
key - a String specifying
the name of the attributeo - an Object containing
the context of the requestpublic java.lang.String getRealPath(java.lang.String path)
ServletContext#getRealPath instead.
public static java.lang.String parseCharacterEncoding(java.lang.String contentType)
contentType - a content type header.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||