Java Doc for PortletRequest.java in  » Portal » Open-Portal » javax » portlet » 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 » Portal » Open Portal » javax.portlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.portlet.PortletRequest

All known Subclasses:   com.sun.portal.portlet.impl.PortletRequestImpl,
PortletRequest
public interface PortletRequest (Code)
The PortletRequest defines the base interface to provide client request information to a portlet. The portlet container uses two specialized versions of this interface when invoking a portlet, ActionRequest and RenderRequest. The portlet container creates these objects and passes them as arguments to the portlet's processAction and render methods.
See Also:   ActionRequest
See Also:   RenderRequest


Field Summary
final public static  StringBASIC_AUTH
     String identifier for Basic authentication.
final public static  StringCLIENT_CERT_AUTH
     String identifier for Certification based authentication.
final public static  StringDIGEST_AUTH
     String identifier for Digest based authentication.
final public static  StringFORM_AUTH
     String identifier for Form based authentication.
final public static  StringUSER_INFO
     Used to retrieve user information attributes with the getAttribute call.


Method Summary
public  ObjectgetAttribute(String name)
     Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
public  java.util.EnumerationgetAttributeNames()
     Returns an Enumeration containing the names of the attributes available to this request.
public  java.lang.StringgetAuthType()
     Returns the name of the authentication scheme used for the connection between client and portal, for example, BASIC_AUTH, CLIENT_CERT_AUTH, a custom one or null if there was no authentication. one of the static members BASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) indicating the authentication scheme, a custom one, or null if the request was not authenticated.
public  StringgetContextPath()
     Returns the context path which is the path prefix associated with the deployed portlet application.
public  java.util.LocalegetLocale()
     Returns the preferred Locale in which the portal will accept content.
public  java.util.EnumerationgetLocales()
     Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale in which the portal will accept content for this request.
public  StringgetParameter(String name)
     Returns the value of a request parameter as a String, or null if the parameter does not exist.
public  java.util.MapgetParameterMap()
     Returns a Map of the parameters of this request. Request parameters are extra information sent with the request.
public  java.util.EnumerationgetParameterNames()
     Returns an Enumeration of String objects containing the names of the parameters contained in this request.
public  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.
public  PortalContextgetPortalContext()
     Returns the context of the calling portal.
public  PortletModegetPortletMode()
     Returns the current portlet mode of the portlet.
public  PortletSessiongetPortletSession()
     Returns the current portlet session or, if there is no current session, creates one and returns the new session.
public  PortletSessiongetPortletSession(boolean create)
     Returns the current portlet session or, if there is no current session and the given flag is true, creates one and returns the new session.
public  PortletPreferencesgetPreferences()
     Returns the preferences object associated with the portlet.
public  java.util.EnumerationgetProperties(String name)
     Returns all the values of the specified request property as a Enumeration of String objects.

If the request did not include any propertys of the specified name, this method returns an empty Enumeration. The property name is case insensitive.

public  StringgetProperty(String name)
     Returns the value of the specified request property as a String.
public  java.util.EnumerationgetPropertyNames()
     Returns a Enumeration of all the property names this request contains.
public  java.lang.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.
public  StringgetRequestedSessionId()
     Returns the session ID indicated in the client request.
public  StringgetResponseContentType()
     Returns the portal preferred content type for the response.

The content type only includes the MIME type, not the character set.

Only content types that the portlet has defined in its deployment descriptor are valid return values for this method call.

public  java.util.EnumerationgetResponseContentTypes()
     Gets a list of content types which the portal accepts for the response. This list is ordered with the most preferable types listed first.

The content type only includes the MIME type, not the character set.

Only content types that the portlet has defined in its deployment descriptor are valid return values for this method call.

public  StringgetScheme()
     Returns the name of the scheme used to make this request.
public  StringgetServerName()
     Returns the host name of the server that received the request.
public  intgetServerPort()
     Returns the port number on which this request was received.
public  java.security.PrincipalgetUserPrincipal()
     Returns a java.security.Principal object containing the name of the current authenticated user.
public  WindowStategetWindowState()
     Returns the current window state of the portlet.
public  booleanisPortletModeAllowed(PortletMode mode)
     Returns true, if the given portlet mode is a valid one to set for this portlet in the context of the current request.
public  booleanisRequestedSessionIdValid()
     Checks whether the requested session ID is still valid.
public  booleanisSecure()
     Returns a boolean indicating whether this request was made using a secure channel between client and the portal, such as HTTPS.
public  booleanisUserInRole(java.lang.String role)
     Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
public  booleanisWindowStateAllowed(WindowState state)
     Returns true, if the given window state is valid to be set for this portlet in the context of the current request.
public  voidremoveAttribute(String name)
     Removes an attribute from this request.
public  voidsetAttribute(String name, Object o)
     Stores an attribute in this request.

Attribute names should follow the same conventions as package names.


Field Detail
BASIC_AUTH
final public static String BASIC_AUTH(Code)
String identifier for Basic authentication. Value "BASIC".



CLIENT_CERT_AUTH
final public static String CLIENT_CERT_AUTH(Code)
String identifier for Certification based authentication. Value "CLIENT_CERT".



DIGEST_AUTH
final public static String DIGEST_AUTH(Code)
String identifier for Digest based authentication. Value "DIGEST".



FORM_AUTH
final public static String FORM_AUTH(Code)
String identifier for Form based authentication. Value "FORM".



USER_INFO
final public static String USER_INFO(Code)
Used to retrieve user information attributes with the getAttribute call. The user information is returned as a Map object. The portlet must define the user information attribute it is interested in inside the user-attribute section of the deployment descriptor. If an attribute is not supported by the current runtime system it will not show up in the user attribute map.
If the user-attribute is supported by the runtime system, but not defined for a particular user, then for that user the attribute exists in the returned map and the attribute has a null value.

If the user-attribute is not defined for the current user it will not show up in the Map.

The value is javax.portlet.userinfo.






Method Detail
getAttribute
public 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.

Attribute names should follow the same conventions as package names. This specification reserves names matching java.*, and javax.*.

In a distributed portlet web application the Object needs to be serializable.
Parameters:
  name - a String specifying the name of the attribute an Object containing the value of the attribute, or null ifthe attribute does not exist.
exception:
  java.lang.IllegalArgumentException - if name is null.




getAttributeNames
public java.util.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 strings containing the names of the request attributes, or an empty Enumeration if the request has no attributes available to it.



getAuthType
public java.lang.String getAuthType()(Code)
Returns the name of the authentication scheme used for the connection between client and portal, for example, BASIC_AUTH, CLIENT_CERT_AUTH, a custom one or null if there was no authentication. one of the static members BASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) indicating the authentication scheme, a custom one, or null if the request was not authenticated.



getContextPath
public String getContextPath()(Code)
Returns the context path which is the path prefix associated with the deployed portlet application. If the portlet application is rooted at the base of the web server URL namespace (also known as "default" context), this path must be an empty string. Otherwise, it must be the path the portlet application is rooted to, the path must start with a '/' and it must not end with a '/' character.

To encode a URL the PortletResponse.encodeURL method must be used. a String specifying theportion of the request URL that indicates the contextof the request
See Also:   PortletResponse.encodeURL




getLocale
public java.util.Locale getLocale()(Code)
Returns the preferred Locale in which the portal will accept content. The Locale may be based on the Accept-Language header of the client. the prefered Locale in which the portal will accept content.



getLocales
public java.util.Enumeration getLocales()(Code)
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale in which the portal will accept content for this request. The Locales may be based on the Accept-Language header of the client. an Enumeration of Locales, in decreasing order, in which the portal will accept content for this request



getParameter
public String getParameter(String name)(Code)
Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. The returned parameter are "x-www-form-urlencoded" decoded.

Only parameters targeted to the current portlet are accessible.

This method should only be used if the parameter has only one value. If the parameter might have more than one value, use PortletRequest.getParameterValues .

If this method is used with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues.
Parameters:
  name - a String specifying the name of the parameter a String representing the single value of the parameter
See Also:   PortletRequest.getParameterValues
exception:
  java.lang.IllegalArgumentException - if name is null.




getParameterMap
public java.util.Map getParameterMap()(Code)
Returns a Map of the parameters of this request. Request parameters are extra information sent with the request. The returned parameters are "x-www-form-urlencoded" decoded.

The values in the returned Map are from type String array (String[]).

If no parameters exist this method returns an empty Map. an immutable Map containing parameter names as keys and parameter values as map values, or an empty Mapif no parameters exist. The keys in the parametermap are of type String. The values in the parameter map are of typeString array (String[]).




getParameterNames
public java.util.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.

Only parameters targeted to the current portlet are returned. an Enumeration of Stringobjects, each String containingthe name of a request parameter; or an empty Enumeration if therequest has no parameters.




getParameterValues
public 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. The returned parameters are "x-www-form-urlencoded" decoded.

If the parameter has a single value, the array has a length of 1.
Parameters:
  name - a String containing the name of the parameter the value of which is requested an array of String objects containing the parameter values.
See Also:   PortletRequest.getParameter
exception:
  java.lang.IllegalArgumentException - if name is null.




getPortalContext
public PortalContext getPortalContext()(Code)
Returns the context of the calling portal. the context of the calling portal



getPortletMode
public PortletMode getPortletMode()(Code)
Returns the current portlet mode of the portlet. the portlet mode



getPortletSession
public PortletSession getPortletSession()(Code)
Returns the current portlet session or, if there is no current session, creates one and returns the new session.

Creating a new portlet session will result in creating a new HttpSession on which the portlet session is based on. the portlet session




getPortletSession
public PortletSession getPortletSession(boolean create)(Code)
Returns the current portlet session or, if there is no current session and the given flag is true, creates one and returns the new session.

If the given flag is false and there is no current portlet session, this method returns null.

Creating a new portlet session will result in creating a new HttpSession on which the portlet session is based on.
Parameters:
  create - true to create a new session,
false to return null if thereis no current session the portlet session




getPreferences
public PortletPreferences getPreferences()(Code)
Returns the preferences object associated with the portlet. the portlet preferences



getProperties
public java.util.Enumeration getProperties(String name)(Code)
Returns all the values of the specified request property as a Enumeration of String objects.

If the request did not include any propertys of the specified name, this method returns an empty Enumeration. The property name is case insensitive. You can use this method with any request property.
Parameters:
  name - a String specifying theproperty name a Enumeration containingthe values of the requested property. Ifthe request does not have any properties ofthat name return an empty Enumeration.
exception:
  java.lang.IllegalArgumentException - if name is null.




getProperty
public String getProperty(String name)(Code)
Returns the value of the specified request property as a String. If the request did not include a property of the specified name, this method returns null.

A portlet can access portal/portlet-container specific properties through this method and, if available, the headers of the HTTP client request.

This method should only be used if the property has only one value. If the property might have more than one value, use PortletRequest.getProperties .

If this method is used with a multivalued parameter, the value returned is equal to the first value in the Enumeration returned by getProperties.
Parameters:
  name - a String specifying theproperty name a String containing thevalue of the requestedproperty, or nullif the request does nothave a property of that name.
exception:
  java.lang.IllegalArgumentException - if name is null.




getPropertyNames
public java.util.Enumeration getPropertyNames()(Code)
Returns a Enumeration of all the property names this request contains. If the request has no properties, this method returns an empty Enumeration. an Enumeration of all theproperty names sent with thisrequest; if the request hasno properties, an empty Enumeration.



getRemoteUser
public java.lang.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. a String specifying the loginof the user making this request, or nullif the user login is not known.



getRequestedSessionId
public String getRequestedSessionId()(Code)
Returns the session ID indicated in the client request. This session ID may not be a valid one, it may be an old one that has expired or has been invalidated. If the client 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:   PortletRequest.isRequestedSessionIdValid



getResponseContentType
public String getResponseContentType()(Code)
Returns the portal preferred content type for the response.

The content type only includes the MIME type, not the character set.

Only content types that the portlet has defined in its deployment descriptor are valid return values for this method call. If the portlet has defined '*' or '* / *' as supported content types, these may also be valid return values. preferred MIME type of the response




getResponseContentTypes
public java.util.Enumeration getResponseContentTypes()(Code)
Gets a list of content types which the portal accepts for the response. This list is ordered with the most preferable types listed first.

The content type only includes the MIME type, not the character set.

Only content types that the portlet has defined in its deployment descriptor are valid return values for this method call. If the portlet has defined '*' or '* / *' as supported content types, these may also be valid return values. ordered list of MIME types for the response




getScheme
public 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 name of the scheme used to make this request



getServerName
public String getServerName()(Code)
Returns the host name of the server that received the request. a String containing the name of the server to which the request was sent



getServerPort
public int getServerPort()(Code)
Returns the port number on which this request was received. an integer specifying the port number



getUserPrincipal
public java.security.Principal getUserPrincipal()(Code)
Returns a java.security.Principal object containing the name of the current authenticated user. a java.security.Principal containingthe name of the user making this request, ornull if the user has not been authenticated.



getWindowState
public WindowState getWindowState()(Code)
Returns the current window state of the portlet. the window state



isPortletModeAllowed
public boolean isPortletModeAllowed(PortletMode mode)(Code)
Returns true, if the given portlet mode is a valid one to set for this portlet in the context of the current request.
Parameters:
  mode - portlet mode to check true, if it is valid for this portletin this request to change to thegiven portlet mode



isRequestedSessionIdValid
public 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:   PortletRequest.getRequestedSessionId
See Also:   PortletRequest.getPortletSession



isSecure
public boolean isSecure()(Code)
Returns a boolean indicating whether this request was made using a secure channel between client and the portal, such as HTTPS. true, if the request was made using a secure channel.



isUserInRole
public boolean isUserInRole(java.lang.String role)(Code)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and role membership can be defined using deployment descriptors. If the user has not been authenticated, the method returns false.
Parameters:
  role - a String specifying the nameof the role a boolean indicating whetherthe user making this request belongs to a given role;false if the user has not been authenticated.



isWindowStateAllowed
public boolean isWindowStateAllowed(WindowState state)(Code)
Returns true, if the given window state is valid to be set for this portlet in the context of the current request.
Parameters:
  state - window state to checked true, if it is valid for this portletin this request to change to thegiven window state



removeAttribute
public 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 specifying the name of the attribute to be removed
exception:
  java.lang.IllegalArgumentException - if name is null.




setAttribute
public void setAttribute(String name, Object o)(Code)
Stores an attribute in this request.

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.
If the value passed into this method is null, the effect is the same as calling PortletRequest.removeAttribute .
Parameters:
  name - a String specifying the name of the attribute
Parameters:
  o - the Object to be stored
exception:
  java.lang.IllegalArgumentException - if name is null.




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