| java.lang.Object org.zkoss.web.portlet.Portlets
Portlets | public class Portlets (Code) | | Utilities to handle portlet.
author: tomyeh |
Field Summary | |
final public static int | APPEND_PARAM Whether to append params if both uri and params contain the same
parameter. | final public static int | IGNORE_PARAM Whether to ignore params if both uri and params contain the same
parameter. | final public static int | OVERWRITE_URI Whether to overwrite uri if both uri and params contain the same
parameter. |
Method Summary | |
final public static String | generateURI(String uri, Map params, int mode) Generates URI by appending the parameters.
Parameters: params - the parameters to apend to the query string Parameters: mode - one of Portlets.OVERWRITE_URI, Portlets.IGNORE_PARAM,and Portlets.APPEND_PARAM. | final public static PortletRequestDispatcher | getRequestDispatcher(PortletContext ctx, String uri, Map params, int mode) Returns the request dispatch of the specified URI.
Parameters: ctx - the context used to resolve a foreign context.It is required only if uri starts with "~". Parameters: uri - the URI to include. | final public static URL | getResource(PortletContext ctx, String uri) Returns the resource of the specified uri. | final public static InputStream | getResourceAsStream(PortletContext ctx, String uri) Returns the resource stream of the specified uri. | final public static void | include(PortletContext ctx, RenderRequest request, RenderResponse response, String uri, Map params, int mode) Includes the resource at the specified URI.
It enhances RequestDispatcher to allow the inclusion with
a parameter map -- acutually converting parameters to a query string
and appending it to uri.
NOTE: don't include query parameters in uri.
Parameters: uri - the URI to include. |
APPEND_PARAM | final public static int APPEND_PARAM(Code) | | Whether to append params if both uri and params contain the same
parameter. In other words, they both appear as the final query string.
Used by
Portlets.generateURI |
IGNORE_PARAM | final public static int IGNORE_PARAM(Code) | | Whether to ignore params if both uri and params contain the same
parameter.
Used by
Portlets.generateURI |
OVERWRITE_URI | final public static int OVERWRITE_URI(Code) | | Whether to overwrite uri if both uri and params contain the same
parameter.
Used by
Portlets.generateURI |
generateURI | final public static String generateURI(String uri, Map params, int mode)(Code) | | Generates URI by appending the parameters.
Parameters: params - the parameters to apend to the query string Parameters: mode - one of Portlets.OVERWRITE_URI, Portlets.IGNORE_PARAM,and Portlets.APPEND_PARAM. It defines how to handle if both uriand params contains the same parameter.mode is used only if both uri contains query string and params isnot empty. |
getRequestDispatcher | final public static PortletRequestDispatcher getRequestDispatcher(PortletContext ctx, String uri, Map params, int mode) throws PortletException(Code) | | Returns the request dispatch of the specified URI.
Parameters: ctx - the context used to resolve a foreign context.It is required only if uri starts with "~". Parameters: uri - the URI to include. It is OK to relevant (without leading'/'). If starts with "/", the context path of request is assumed.To reference to foreign context, use "~ctx/" where ctx is thecontext path of the foreign context (without leading '/'). Parameters: params - the parameter map; null to ignore Parameters: mode - one of Portlets.OVERWRITE_URI, Portlets.IGNORE_PARAM,and Portlets.APPEND_PARAM. It defines how to handle if both uriand params contains the same parameter. |
include | final public static void include(PortletContext ctx, RenderRequest request, RenderResponse response, String uri, Map params, int mode) throws IOException, PortletException(Code) | | Includes the resource at the specified URI.
It enhances RequestDispatcher to allow the inclusion with
a parameter map -- acutually converting parameters to a query string
and appending it to uri.
NOTE: don't include query parameters in uri.
Parameters: uri - the URI to include. It is OK to relevant (without leading'/'). If starts with "/", the context path of request is assumed.To reference to foreign context, use "~ctx/" where ctx is thecontext path of the foreign context (without leading '/'). Parameters: params - the parameter map; null to ignore Parameters: mode - one of Portlets.OVERWRITE_URI, Portlets.IGNORE_PARAM,and Portlets.APPEND_PARAM. It defines how to handle if both uriand params contains the same parameter. |
|
|