Java Doc for Request.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » environment » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » apache lenya 2.0 » org.apache.cocoon.environment 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.environment.Request

All known Subclasses:   org.apache.cocoon.environment.wrapper.RequestWrapper,  org.apache.cocoon.environment.mock.MockRequest,  org.apache.cocoon.environment.commandline.CommandLineRequest,  org.apache.cocoon.environment.portlet.PortletRequest,  org.apache.cocoon.environment.http.HttpRequest,
Request
public interface Request (Code)
Defines an interface to provide client request information .
author:
   Davanum Srinivas
author:
   Carsten Ziegeler
author:
   Berin Loritsch
version:
   $Id: Request.java 433543 2006-08-22 06:22:54Z crossley $




Method Summary
 Objectget(String name)
     Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
 ObjectgetAttribute(String name)
     Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
 EnumerationgetAttributeNames()
     Returns an Enumeration containing the names of the attributes available to this request.
 StringgetAuthType()
    
 StringgetCharacterEncoding()
     Returns the name of the character encoding used in the body of this request.
 intgetContentLength()
    
 StringgetContentType()
    
 StringgetContextPath()
     Returns the portion of the request URI that indicates the context of the request.
 MapgetCookieMap()
     Returns a map of the Cookie objects the client sent with this request, indexed by name.
 Cookie[]getCookies()
     Returns an array containing all of the Cookie objects the client sent with this request.
 longgetDateHeader(String name)
     Returns the value of the specified request header as a long value that represents a Date object.
 StringgetHeader(String name)
     Returns the value of the specified request header as a String.
 EnumerationgetHeaderNames()
     Returns an enumeration of all the header names this request contains.
 EnumerationgetHeaders(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.

 LocalegetLocale()
     Returns the preferred Locale that the client will accept content in, based on the Accept-Language header.
 EnumerationgetLocales()
     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.
 StringgetMethod()
     Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 StringgetParameter(String name)
    
 EnumerationgetParameterNames()
     Returns an Enumeration of String objects containing the names of the parameters contained in this request.
 String[]getParameterValues(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.
 StringgetPathInfo()
     Returns any extra path information associated with the URL the client sent when it made this request.
 StringgetPathTranslated()
     Returns any extra path information after the servlet name but before the query string, and translates it to a real path.
 StringgetProtocol()
     Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.
 StringgetQueryString()
     Returns the query string that is contained in the request URL after the path.
 StringgetRemoteAddr()
     Returns the Internet Protocol (IP) address of the client that sent the request.
 StringgetRemoteHost()
     Returns the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined.
 StringgetRemoteUser()
     Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication.
 StringgetRequestURI()
     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.
 StringgetRequestedSessionId()
     Returns the session ID specified by the client.
 StringgetScheme()
     Returns the name of the scheme used to make this request, for example, http, https, or ftp.
 StringgetServerName()
     Returns the host name of the server that received the request.
 intgetServerPort()
     Returns the port number on which this request was received.
 StringgetServletPath()
     Returns the part of this request's URL that calls the servlet.
 SessiongetSession(boolean create)
     Returns the current Session associated with this request or, if if there is no current session and create is true, returns a new session.
 SessiongetSession()
     Returns the current session associated with this request, or if the request does not have a session, creates one.
 StringgetSitemapURI()
    

Returns the URI of the requested resource as interpreted by the sitemap. For example, if your webapp is mounted at "/webapp" and the HTTP request is for "/webapp/foo", this method returns "foo".

 StringgetSitemapURIPrefix()
    

Returns the URI Prefix of the requested resource where the sitemap is mounted.

 PrincipalgetUserPrincipal()
     Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication.
 booleanisRequestedSessionIdFromCookie()
     Checks whether the requested session ID came in as a cookie.
 booleanisRequestedSessionIdFromURL()
     Checks whether the requested session ID came in as part of the request URL.
 booleanisRequestedSessionIdValid()
     Checks whether the requested session ID is still valid.
 booleanisSecure()
     Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
 booleanisUserInRole(String role)
     Checks whether the currently logged in user is in a specified role.
 voidremoveAttribute(String name)
     Removes an attribute from this request.
 voidsetAttribute(String name, Object o)
     Stores an attribute in this request. Attributes are reset between requests.

Attribute names should follow the same conventions as package names.

 voidsetCharacterEncoding(String enc)
     Overrides the charactor encoding of parameters.



Method Detail
get
Object get(String name)(Code)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
Parameters:
  name - a String specifying the name ofthe attribute an Object containing the valueof the attribute, or null ifthe attribute does not exist



getAttribute
Object getAttribute(String name)(Code)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
Parameters:
  name - a String specifying the name ofthe attribute an Object containing the valueof the attribute, or null ifthe attribute does not exist



getAttributeNames
Enumeration getAttributeNames()(Code)
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. an Enumeration of stringscontaining the namesof the request's attributes



getAuthType
String getAuthType()(Code)
Returns the name of the authentication scheme used to protect the servlet, for example, "BASIC" or "SSL," or null if the servlet was not protected The name of the authentication scheme used toprotect the servlet, or null if the servlet wasnot protected



getCharacterEncoding
String getCharacterEncoding()(Code)
Returns the name of the character encoding used in the body of this request. This method returns null if the request does not specify a character encoding a String containing the name ofthe chararacter encoding, or nullif the request does not specify a character encoding



getContentLength
int getContentLength()(Code)
Returns the length, in bytes, of the request body an integer containing the length of therequest body or -1 if the length is not known



getContentType
String getContentType()(Code)
Returns the MIME type of the body of the request a String containing the nameof the MIME type ofthe request, or -1 if the type is not known



getContextPath
String getContextPath()(Code)
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 "". a String specifying theportion of the request URI that indicates the contextof the request



getCookieMap
Map getCookieMap()(Code)
Returns a map of the Cookie objects the client sent with this request, indexed by name. This method returns an empty map if no cookies were sent. a Map of Cookie objects



getCookies
Cookie[] getCookies()(Code)
Returns an array containing all of the Cookie objects the client sent with this request. This method returns null if no cookies were sent. an array of all the Cookiesincluded with this request, or nullif the request has no cookies



getDateHeader
long getDateHeader(String name)(Code)
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 throws an IllegalArgumentException.
Parameters:
  name - a String specifying thename of the header a long valuerepresenting the date specifiedin the header expressed asthe number of millisecondssince January 1, 1970 GMT,or -1 if the named headerwas not included with thereqest
exception:
  IllegalArgumentException - If the header valuecan't be convertedto a date




getHeader
String getHeader(String name)(Code)
Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. The header name is case insensitive. You can use this method with any request header.
Parameters:
  name - a String specifying theheader name a String containing thevalue of the requestedheader, or nullif the request does nothave a header of that name



getHeaderNames
Enumeration getHeaderNames()(Code)
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 containers do not allow do not allow servlets to access headers using this method, in which case this method returns null an enumeration of all theheader names sent with thisrequest; if the request hasno headers, an empty enumeration;if the servlet container does notallow servlets to use this method,null




getHeaders
Enumeration getHeaders(String name)(Code)
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.
Parameters:
  name - a String specifying theheader name a Enumeration containing thevalues of the requestedheader, or nullif the request does nothave any headers of that name




getLocale
Locale getLocale()(Code)
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. the preferred Locale for the client



getLocales
Enumeration getLocales()(Code)
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. an Enumeration of preferredLocale objects for the client



getMethod
String getMethod()(Code)
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. Same as the value of the CGI variable REQUEST_METHOD. a Stringspecifying the nameof the method with whichthis request was made



getParameter
String getParameter(String name)(Code)
Returns the value of a request parameter as a String,
Parameters:
  name - a String specifying thename of the parameter a String representing thesingle value of the parameter
See Also:   Request.getParameterValues(String)



getParameterNames
Enumeration getParameterNames()(Code)
Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration. an Enumeration of Stringobjects, each String containingthe name of a request parameter; or anempty Enumeration if therequest has no parameters



getParameterValues
String[] getParameterValues(String name)(Code)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

If the parameter has a single value, the array has a length of 1.
Parameters:
  name - a String containing the name ofthe parameter whose value is requested an array of String objectscontaining the parameter's values
See Also:   Request.getParameter(String)




getPathInfo
String getPathInfo()(Code)
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 but precedes the query string. This method returns null if there was no extra path information.

Same as the value of the CGI variable PATH_INFO. a String specifyingextra path information that comesafter the servlet path but beforethe query string in the request URL;or null if the URL does not haveany extra path information




getPathTranslated
String getPathTranslated()(Code)
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. a String specifying thereal path, or null ifthe URL does not have any extra pathinformation




getProtocol
String getProtocol()(Code)
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. For HTTP servlets, the value returned is the same as the value of the CGI variable SERVER_PROTOCOL. a String containing the protocolname and version number



getQueryString
String getQueryString()(Code)
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. a String containing the querystring or null if the URLcontains no query string



getRemoteAddr
String getRemoteAddr()(Code)
Returns the Internet Protocol (IP) address of the client that sent the request. For HTTP servlets, same as the value of the CGI variable REMOTE_ADDR. a String containing theIP address of the client that sent the request



getRemoteHost
String getRemoteHost()(Code)
Returns the fully qualified name of the client that sent the request, or the IP address of the client if the name cannot be determined. For HTTP servlets, same as the value of the CGI variable REMOTE_HOST. a String containing the fully qualified nameof the client



getRemoteUser
String getRemoteUser()(Code)
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER. a String specifying the loginof the user making this request, or null



getRequestURI
String getRequestURI()(Code)
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
a String containingthe part of the URL from theprotocol name up to the query string



getRequestedSessionId
String getRequestedSessionId()(Code)
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. a String specifying the sessionID, or null if the request didnot specify a session ID
See Also:   Request.isRequestedSessionIdValid()



getScheme
String getScheme()(Code)
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. a String containing the nameof the scheme used to make this request



getServerName
String getServerName()(Code)
Returns the host name of the server that received the request. For HTTP servlets, same as the value of the CGI variable SERVER_NAME. a String containing the nameof the server to which the request was sent



getServerPort
int getServerPort()(Code)
Returns the port number on which this request was received. For HTTP servlets, same as the value of the CGI variable SERVER_PORT. an integer specifying the port number



getServletPath
String getServletPath()(Code)
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. a String containingthe name or path of the servlet beingcalled, as specified in the request URL



getSession
Session getSession(boolean create)(Code)
Returns the current Session associated with this request or, if if there is no current session and create is true, returns a new session.

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

To make sure the session is properly maintained, you must call this method before the response is committed.
Parameters:
  create - true to createa new session for this request if necessary;false to return nullif there's no current session the Session associatedwith this request or null ifcreate is falseand the request has no valid session
See Also:   Request.getSession()




getSession
Session getSession()(Code)
Returns the current session associated with this request, or if the request does not have a session, creates one. the Session associatedwith this request
See Also:   Request.getSession(boolean)



getSitemapURI
String getSitemapURI()(Code)

Returns the URI of the requested resource as interpreted by the sitemap. For example, if your webapp is mounted at "/webapp" and the HTTP request is for "/webapp/foo", this method returns "foo". Consequently, if the request is for "/webapp", this method returns an empty string.

Note that if the request is mapped to a pipeline that contains aggregated content, and if this method is called in the context of one of the aggregated parts (e.g. a server page), this method will return the URI of the aggregated part, not the original requested URI.

a String containing the URL as mangled by thesitemap



getSitemapURIPrefix
String getSitemapURIPrefix()(Code)

Returns the URI Prefix of the requested resource where the sitemap is mounted. For example, if your webapp is mounted at "/webapp" and the HTTP request is for "/webapp/foo", this method returns "webapp/".

a String containing the URI prefix as mangled by thesitemap



getUserPrincipal
Principal getUserPrincipal()(Code)
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER. a String specifying the loginof the user making this request, or null



isRequestedSessionIdFromCookie
boolean isRequestedSessionIdFromCookie()(Code)
Checks whether the requested session ID came in as a cookie. true if the session IDcame in as acookie; otherwise, false
See Also:   Request.getSession()



isRequestedSessionIdFromURL
boolean isRequestedSessionIdFromURL()(Code)
Checks whether the requested session ID came in as part of the request URL. true if the session IDcame in as part of a URL; otherwise,false
See Also:   Request.getSession()



isRequestedSessionIdValid
boolean isRequestedSessionIdValid()(Code)
Checks whether the requested session ID is still valid. true if thisrequest has an id for a valid sessionin the current session context;false otherwise
See Also:   Request.getRequestedSessionId()
See Also:   Request.getSession()



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



isUserInRole
boolean isUserInRole(String role)(Code)
Checks whether the currently logged in user is in a specified role. true if the user isauthenticated and in the role;otherwise, false
See Also:   Request.getRemoteUser()



removeAttribute
void removeAttribute(String name)(Code)
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.
Parameters:
  name - a String specifyingthe name of the attribute to remove




setAttribute
void setAttribute(String name, Object o)(Code)
Stores an attribute in 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.
Parameters:
  name - a String specifyingthe name of the attribute
Parameters:
  o - the Object to be stored




setCharacterEncoding
void setCharacterEncoding(String enc) throws java.io.UnsupportedEncodingException(Code)
Overrides the charactor encoding of parameters.
throws:
  java.io.UnsupportedEncodingException - if this is not a valid encoding.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.