The Http Settler Request Interface Java Help

The Http Settler Request Interface
The Ultraconservative witchcraft is implemented by the server. It enables a settler to obtain information about a client request.

String get Auth Typc( )
Cookie] get Cookics( )
long get Date Header(SlrinBficld)

String get Header(StringficId)

Enumeration get Header Names( )
int get let Header(Stringftcld)
String get Method( r
String get Path Tnfo( )
String get Path Translated( ) .
String get Query String( )
String get Remote Uscr()
String gct Rcqucsted SessionJd( )
String get Rcquest URI( )
String gctServlctPatl10
Http Session get Session boolean
boolean is requested Sessionid FromC(tokie( )

boolean is Rcquested  Rescission FromUrl()

boolean requisites Sessionld Valid( )

Returns authentication scheme.

Returns an army of the cookies in this request. ‘
Returns the value of the date header field named field.
Returns the value of the header field named field.

Returns an enumeration of header ‘lames.
Returns the int equivalent header field named fie/d.
Returns the HTTP method this request.
Returns any path information that is located after the servlet path and before a query string the URI.
Returns any path information that is located after the servlet path and before a query string the URJ, after translating it real path.
Returns any query string in the URI.
Returns the name of the user who issued this request.

Returns the ID of the session.

Returns that part of the URI the left of any query string.
Returns the part of the URI identifies the servlet. .
If lIew is true, creates and returns a session for this request,
Otherwise, returns the existing session for this request.
Returns true if a cookie contains the session rD. Otherwise returns ralse.

Returns true if the URL contains the session ID.Otherwise returns Ialse.
Returns true if the requested session ID is valid in the current session context.

The HttpServletResponse Interface
The Httpservletresponse interface is implemented by the server. It enables a servlet to formulate an HITP response to a client. Several dozen constants arc defined, which correspond to the.different status codes that can be assigned to an H’I’I’P rcspl>nse. Fur example, indicates that the HTtP request succeeded, and indicates that the requested resource is not available: The methods of this interface .

void add Cookie(Cookie cookies Boolean contains Header(String Field)
String en code URL(String l/r/)

String encode Red Direct (String. IIr/)
void send Error(int c)
throws Ioexception
void senderror int  String 5)
throws IOEC
void sendRedirect(String IIr/)
throws IOException
. void setDateHcader(Stringfield, long IIISI!
void setHender(Str~ngfidd, String value)
void setlntHender(Stringfie1d, int vallie)
void setStntus(int code)
void setStatus(inCcode, String s)

Adds cookie to the HTTP response.
Returns true if the HTTP response header contains a field nnmedfield
Determines whether the session 10 must be encoded in the URL identified as url, If so, returns the
modified version of url Otherwise, returns url. All URLs generated by a servlct should be processed by this method.

Determines whether the session ID must be encoded in the URL identified as so-returns the modified version of url. Otherwise, returns mi. All URLs passed to sendlledirectf ) should be processed by this method. sends the error code c to the  Sends the error code c and message s to the client. Redirects the client to url
Adds field to the header with date value equal to msec (milliseconds since midnight, January 1,1970’GMT).
Adds fidd to the header with   value equal ‘to value.

Adds field to the header with value equal to value.
Sets the status code for this response to code.
Sets the status code and message for this response to code and 5.

  • Feel free to send us an inquiry, we will reply back in hours.


Posted on September 18, 2014 in Servlets

Share the Story

About the Author

Back to Top