| javax.servlet.http.HttpServlet com.caucho.portal.generic.PortletServlet
PortletServlet | public class PortletServlet extends HttpServlet implements Window,PortletConfig(Code) | | A servlet that uses a class implementing javax.portlet.Portlet.
This servlet supports the following configuration items.
Items marked with a * can be set as init-param.
- portal
- an instance of
Portal , default is an instance of
GenericPortal .
- portal-class*
- a class name, an alternative to
portal
- portal-ref*
- an attribute name to use for a lookup for a
Portal as
an application attribute. This is an alternative to using
portal and is useful when more than one portlet
servlet share a Portal.
- portlet
- an instance of
javax.portlet.Portlet , required
- portlet-class*
- a class name, an alternative to
portlet
- portlet-name*
- a name for the value of
javax.portlet.PortletConfig.getPortletName ,
the default is ServletConfig.getServletName()
- portlet-preferences
- Set the default preferences for the portlet
(see "Portlet Preferences")
- expiration-cache*
- an integer, a cache time in seconds for the portlet, 0 (the default)
disables and -1 means forever
- private*
- "true" or "false", if true the response is marked as private for
the client, no cache will share the response with other users
- supported-locales*
A comma-separated list of locales of the form "en-us" or "en_us', the
default is to support all locales.
- resource-bundle*
- the name of a resource bundle, the portlet may use the resource bundle
with
javax.portlet.PortletConfig.getResourceBundle(Locale)
- renderer
- an instance of
Renderer , used to add decorations like headers
footers and controls to the portlet, the default is no renderer. See
AbstractRenderer .
- renderer-class*
- a class name, an alternative to
renderer
PortletServlet.setRenderer(Renderer) .
<servlet servlet-name="portal"
servlet-class="com.caucho.portal.generic.PortletServlet">
<init>
...
<portlet-preferences>
<preference name="colour" value="green" read-only="true"/>
or
<preference>
<name>colour</name>
<value>green</value>
<read-only>true</read-only>
</preference>
</portlet-preferences>
...
</init>
</servlet>
|
Field Summary | |
final protected static Logger | log |
Method Summary | |
public void | addInitParam(String name, String value) Add an init-param for the portlet. | public void | addInitParam(NameValuePair nameValuePair) | void | addSupportedLocale(String locale) Add a supported locale, the default is to support all locales. | void | addSupportedLocales(String locales) Add supported locales with a comma separated list, the default is to
support all locales. | public void | destroy() | protected void | doGet(HttpServletRequest req, HttpServletResponse res) | protected void | doPost(HttpServletRequest req, HttpServletResponse res) | protected void | doRequest(HttpServletRequest httpRequest, HttpServletResponse httpResponse) | public int | getBufferSize() | public ArrayList<Constraint> | getConstraints() This implementation returns null. | public PortletPreferences | getDefaultPreferences() This implementation returns null. | public int | getExpirationCache() | public String | getInitParameter(String name) | public Enumeration | getInitParameterNames() | public PortletConfig | getPortletConfig() | public PortletContext | getPortletContext() | public String | getPortletName() | public ArrayList<PreferencesValidator> | getPreferencesValidators() | public Renderer | getRenderer() | public ResourceBundle | getResourceBundle(Locale locale) | public Map<String, String> | getRoleRefMap() This implementation returns null. | public Set<String> | getSupportedContentTypes(PortletMode portletMode) This implementation returns null, which means that all content
types are supported. | public Set<Locale> | getSupportedLocales() This implementation returns null, which means that all locales are
supported. | public void | handleConstraintFailure(RenderRequest request, RenderResponse response, ConstraintFailureEvent event) This implementation does nothing. | public void | handleException(RenderRequest request, RenderResponse response, ExceptionEvent event) This implementation does nothing. | public PortletMode | handlePortletModeFailure(PortletRequest request, PortletMode notAllowed) This implementation returns PortletMode.VIEW. | public WindowState | handleWindowStateFailure(PortletRequest request, WindowState notAllowed) This implementation returns WindowState.NORMAL. | public void | init(ServletConfig servletConfig) | public boolean | isPortletModeAllowed(PortletRequest request, PortletMode portletMode) This implementation returns true. | public boolean | isPrivate() | public boolean | isWindowStateAllowed(PortletRequest request, WindowState windowState) This implementation returns true. | protected Object | newInstance(Class targetClass, String className) | public void | setBufferSize(int bufferSize) | public void | setExpirationCache(int expirationCache) Enable caching of the response and set the expiration time in seconds. | public void | setNamespace(String namespace) The namespace is used to uniquely identify this usage of the portlet,
the default is "" (the empty string). | public void | setPortal(Portal portal) Default is an instance of
GenericPortal . | public void | setPortalClass(String className) | public void | setPortalRef(String attributeName) An alternative to
PortletServlet.setPortal(Portal) , specify the name
of an attribute to lookup in the ServletContext. | public void | setPortlet(Portlet portlet) The portlet, required. | public void | setPortletClass(String className) | public void | setPortletName(String portletName) | public void | setPortletPreferences(GenericPortletPreferences defaultPreferences) Set the default preferences. | public void | setPrivate(boolean isPrivate) If true then the response is private, indicating that it contains
information that should only be provided to the current client, default is
false. | public void | setRenderer(Renderer renderer) A Renderer wraps decorations around the portlet, see
AbstractRenderer . | public void | setRendererClass(String className) | public void | setResourceBundle(String name) Set a resource bundle name, used to instantiate an instance of
ResourceBundleFactory. | public void | setResourceBundleFactory(ResourceBundleFactory factory) |
addInitParam | public void addInitParam(String name, String value)(Code) | | Add an init-param for the portlet. If no init-param are added, the
default behaviour is to expose the Servlet's init-param to the portlet.
If this method is called at least once, the Servlet's init-param are not
exposed to the portlet.
|
addSupportedLocale | void addSupportedLocale(String locale)(Code) | | Add a supported locale, the default is to support all locales.
This is an ordered list, those added first are more preferrable.
|
addSupportedLocales | void addSupportedLocales(String locales)(Code) | | Add supported locales with a comma separated list, the default is to
support all locales. This is an ordered list, those added first are more
preferrable.
|
destroy | public void destroy()(Code) | | |
getBufferSize | public int getBufferSize()(Code) | | |
getDefaultPreferences | public PortletPreferences getDefaultPreferences()(Code) | | This implementation returns null.
|
getExpirationCache | public int getExpirationCache()(Code) | | |
getPortletConfig | public PortletConfig getPortletConfig()(Code) | | |
getPortletContext | public PortletContext getPortletContext()(Code) | | |
getPreferencesValidators | public ArrayList<PreferencesValidator> getPreferencesValidators()(Code) | | |
getSupportedContentTypes | public Set<String> getSupportedContentTypes(PortletMode portletMode)(Code) | | This implementation returns null, which means that all content
types are supported.
|
getSupportedLocales | public Set<Locale> getSupportedLocales()(Code) | | This implementation returns null, which means that all locales are
supported.
|
handleConstraintFailure | public void handleConstraintFailure(RenderRequest request, RenderResponse response, ConstraintFailureEvent event)(Code) | | This implementation does nothing.
|
handleException | public void handleException(RenderRequest request, RenderResponse response, ExceptionEvent event)(Code) | | This implementation does nothing.
|
handlePortletModeFailure | public PortletMode handlePortletModeFailure(PortletRequest request, PortletMode notAllowed)(Code) | | This implementation returns PortletMode.VIEW.
|
handleWindowStateFailure | public WindowState handleWindowStateFailure(PortletRequest request, WindowState notAllowed)(Code) | | This implementation returns WindowState.NORMAL.
|
isPortletModeAllowed | public boolean isPortletModeAllowed(PortletRequest request, PortletMode portletMode)(Code) | | This implementation returns true.
|
isPrivate | public boolean isPrivate()(Code) | | |
isWindowStateAllowed | public boolean isWindowStateAllowed(PortletRequest request, WindowState windowState)(Code) | | This implementation returns true.
|
setBufferSize | public void setBufferSize(int bufferSize)(Code) | | Default is 0
|
setExpirationCache | public void setExpirationCache(int expirationCache)(Code) | | Enable caching of the response and set the expiration time in seconds. 0
(the default) means do not cache, -1 means unlimited cach time, any other
number is the number of seconds for which the response can be cached.
Can also be specified with
init-param `expiration-cache'.
|
setNamespace | public void setNamespace(String namespace)(Code) | | The namespace is used to uniquely identify this usage of the portlet,
the default is "" (the empty string).
The namespace is important when using a portlet preferences store,
and also has an effect on the encoding of parameters.
|
setPortalRef | public void setPortalRef(String attributeName)(Code) | | An alternative to
PortletServlet.setPortal(Portal) , specify the name
of an attribute to lookup in the ServletContext. This is useful
for sharing a Portal amongst different servlets.
|
setPortlet | public void setPortlet(Portlet portlet)(Code) | | The portlet, required. This method can be called in derived classes,
or through the use of depndency injection on containers that support it,
or indirectly using the init param `portlet-class'.
|
setPortletName | public void setPortletName(String portletName)(Code) | | The default is the value of ServletConfig.getServletName()
|
setPrivate | public void setPrivate(boolean isPrivate)(Code) | | If true then the response is private, indicating that it contains
information that should only be provided to the current client, default is
false. Setting this to true has an effect on caching, if true then a
cached value
cannot be shared amongst different users and the effectiveness of caching
is greatly reduced.
Can also be specified with
init-param `private'.
|
setResourceBundle | public void setResourceBundle(String name)(Code) | | Set a resource bundle name, used to instantiate an instance of
ResourceBundleFactory.
|
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|