Tuesday, March 29, 2011

java HttpRequest

The interface HttpRequest is located in package javax.servlet.http.

Here are some important members:
* Cookie[] getCookies()
* String getHeader(java.lang.String name) - Returns the value of the specified request header as a String
* String getMethod() - GET, POST, or PUT
* String getQueryString() - Returns the query string that is contained in the request URL after the path.
* String getRemoteUser() - Returns the login of the user making this request, if the user has been authenticated;
* String getRequestURI() - Returns the part of this request's URL from the protocol name up to the query string;
* StringBuffer getRequestURL() - Reconstructs the URL the client used to make the request;
* HttpSession getSession( boolean create );
* boolean isUserInRole( String role );

----
And some inherited from javax.servlet.http.Request:
* Object getAttribute( String name );
* Enumeration getAttributeNames();
* String getContentType() - Returns the MIME type of the body of the request;
* String getParameter( String name );
* Enumeration getParameterNames();
* String getServerName();
* int getServerPort();
* String getRemoteHost() - Returns the fully qualified name of the client ( or the last proxy that sent the request);
* setAttribute( String name, Object o);
* removeAttribute(java.lang.String name);
* Locale getLocale();

No comments:

Post a Comment