| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PortletContext
The PortletContext interface defines a portlet's view of the web application within which each portlet is running. The PortletContext also allows a portlet to access resources available to it. Using the context, a portlet can access the portlet log, and obtain URL references to resources.
The scope of a portlet context is an entire web application (abstract porlet application) as for the correcponding servlet context. There is one portlet context per weba application per JVM.
Method Summary | |
---|---|
java.lang.Object | getAttribute(java.lang.String name)
Deprecated. Returns the attribute value with the given name, or null if no such attribute exists. |
java.util.Enumeration | getAttributeNames()
Deprecated. Returns an enumeration of the attribute names that this portlet context is aware of. |
java.lang.String | getContainerInfo()
Deprecated. Returns the name and version of the portlet container which the portlet is running in. |
java.lang.String | getInitParameter(java.lang.String name)
Deprecated. Returns the value of the context-wide initialization parameter with the given name, or null if the parameter does not exist. |
java.util.Enumeration | getInitParameterNames()
Deprecated. Returns the names of this contexts initialization parameters as an enumeration, or an empty enumeration if this context has no initialization parameters. |
PortletLog | getLog()
Deprecated. Returns the portlet log which allows the portlet to write debug, informational, warning, or error messages to a log. |
int | getMajorVersion()
Deprecated. Returns the major version of the Portlet API that this portlet container supports. |
int | getMinorVersion()
Deprecated. Returns the minor version of the Portlet API that this portlet container supports. |
java.io.InputStream | getResourceAsStream(java.lang.String path)
Deprecated. Returns the resource located at the given path as an InputStream object. |
java.io.InputStream | getResourceAsStream(java.lang.String path,
Client client,
java.util.Locale locale)
Deprecated. Returns the resource located at the given path as an InputStream object. |
PortletService | getService(java.lang.Class service)
Deprecated. This function looks up a portlet service with the given classname. |
java.lang.String | getText(java.lang.String bundle,
java.lang.String key,
java.util.Locale locale)
Deprecated. Returns the localized text resource with the given key and using the given locale. |
void | include(java.lang.String path,
PortletRequest request,
PortletResponse response)
Deprecated. Allows the portlet to delegate the rendering to another resource as specified by the given path. |
void | removeAttribute(java.lang.String name)
Deprecated. Removes the attribute with the given name. |
void | send(java.lang.String portletName,
DefaultPortletMessage message)
Deprecated. Sends the given message to all portlets on the same page that have the given name regardless of the portlet application. |
void | send(java.lang.String portletName,
PortletMessage message)
Deprecated. Sends the given message to all portlets in the same portlet application on the same page that have the given name. |
void | send(java.lang.String portletName,
PortletMessage message,
PortletRequest request)
Deprecated. since Version 1.1 |
void | setAttribute(java.lang.String name,
java.lang.Object value)
Deprecated. Associates an attribute with the given name and value with this context. |
Method Detail |
---|
java.lang.String getInitParameter(java.lang.String name)
This method returns the same value as ServletContext#getInitParameter for a servlet in the same web application.
java.util.Enumeration getInitParameterNames()
This method returns the same values as ServletContext#getInitParameterNames for a servlet in the same web application.
void setAttribute(java.lang.String name, java.lang.Object value)
This method has the same effect as ServletContext#setAttribute for a servlet in the same web application.
java.lang.Object getAttribute(java.lang.String name)
This method returns the same value as ServletContext#getAttribute for a servlet in the same web application.
java.util.Enumeration getAttributeNames()
This method returns the same values as ServletContext#getAttributeNames for a servlet in the same web application.
void removeAttribute(java.lang.String name)
This method has the same effect as ServletContext#removeAttribute for a servlet in the same web application.
void include(java.lang.String path, PortletRequest request, PortletResponse response) throws PortletException, java.io.IOException
To access protected resources the path has to be prefixed with /WEB-INF/ (e.g. /WEB-INF/myportlet/myportlet.jsp). Otherwise, the direct path is used. (e.g. /myportlet/myportlet.jsp).
This method is enabled for multi-language and multi-device support. For example, a jsp file "/myportlet/mytemplate.jsp" will be searched for in the following order, when accessing via HTML-Browser:
java.io.InputStream getResourceAsStream(java.lang.String path)
The data in the InputStream can be of any type or length. The method returns null if no resource exists at the given path.
To access protected resources the path has to be prefixed with /WEB-INF/ (e.g. /WEB-INF/myportlet/myportlet.jsp). Otherwise, the direct path is used. (e.g. /myportlet/myportlet.jsp).
java.io.InputStream getResourceAsStream(java.lang.String path, Client client, java.util.Locale locale)
The data in the InputStream can be of any type or length. The method returns null if no resource exists at the given path.
To access protected resources the path has to be prefixed with /WEB-INF/ (e.g. /WEB-INF/myportlet/myportlet.jsp). Otherwise, the direct path is used. (e.g. /myportlet/myportlet.jsp).
This method is enabled for multi-language and multi-device support. For example, a jsp file "/myportlet/mytemplate.jsp" will be searched for in the following order, when accessing via HTML-Browser:
java.lang.String getText(java.lang.String bundle, java.lang.String key, java.util.Locale locale)
To use this feature, the portlet application's CLASSPATH has to contain a resource bundle with the same name (including the package) as the portlet.
void send(java.lang.String portletName, PortletMessage message, PortletRequest request) throws AccessDeniedException
The portlet(s) with the given name will only receive the message event if it has/they have implemented the appropriate listener.
This function may only be used during event processing, in any other case the method throws an AccessDeniedException.
void send(java.lang.String portletName, PortletMessage message) throws AccessDeniedException
The portlet(s) with the given name will only receive the message event if it has/they have implemented the appropriate listener.
This function may only be used during event processing, in any other case the method throws an AccessDeniedException.
void send(java.lang.String portletName, DefaultPortletMessage message) throws AccessDeniedException
The portlet(s) with the given name will only receive the message event if it has/they have implemented the appropriate listener.
This function may only be used during event processing, in any other case the method throws an AccessDeniedException.
PortletService getService(java.lang.Class service) throws PortletServiceUnavailableException, PortletServiceNotFoundException
Using this method a portlet is able to get additional functionality like a service to get external content over a firewall or to include a servlet.
int getMajorVersion()
int getMinorVersion()
java.lang.String getContainerInfo()
The form of the returned string is
PortletLog getLog()
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |