public class Portlets
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
APPEND_PARAM
Whether to append params if both uri and params contain the same
parameter.
|
static int |
IGNORE_PARAM
Whether to ignore params if both uri and params contain the same
parameter.
|
static int |
OVERWRITE_URI
Whether to overwrite uri if both uri and params contain the same
parameter.
|
Constructor and Description |
---|
Portlets() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
generateURI(java.lang.String uri,
java.util.Map params,
int mode)
Generates URI by appending the parameters.
|
static javax.portlet.PortletRequestDispatcher |
getRequestDispatcher(javax.portlet.PortletContext ctx,
java.lang.String uri,
java.util.Map params,
int mode)
Returns the request dispatch of the specified URI.
|
static java.net.URL |
getResource(javax.portlet.PortletContext ctx,
java.lang.String uri)
Returns the resource of the specified uri.
|
static java.io.InputStream |
getResourceAsStream(javax.portlet.PortletContext ctx,
java.lang.String uri)
Returns the resource stream of the specified uri.
|
static void |
include(javax.portlet.PortletContext ctx,
javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response,
java.lang.String uri,
java.util.Map params,
int mode)
Includes the resource at the specified URI.
|
public static final int OVERWRITE_URI
generateURI(java.lang.String, java.util.Map, int)
public static final int IGNORE_PARAM
generateURI(java.lang.String, java.util.Map, int)
public static final int APPEND_PARAM
generateURI(java.lang.String, java.util.Map, int)
public static final void include(javax.portlet.PortletContext ctx, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, java.lang.String uri, java.util.Map params, int mode) throws java.io.IOException, javax.portlet.PortletException
NOTE: don't include query parameters in uri.
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 the
context path of the foreign context (without leading '/').params
- the parameter map; null to ignoremode
- one of OVERWRITE_URI
, IGNORE_PARAM
,
and APPEND_PARAM
. It defines how to handle if both uri
and params contains the same parameter.java.io.IOException
javax.portlet.PortletException
public static final javax.portlet.PortletRequestDispatcher getRequestDispatcher(javax.portlet.PortletContext ctx, java.lang.String uri, java.util.Map params, int mode) throws javax.portlet.PortletException
ctx
- the context used to resolve a foreign context.
It is required only if uri starts with "~".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 the
context path of the foreign context (without leading '/').params
- the parameter map; null to ignoremode
- one of OVERWRITE_URI
, IGNORE_PARAM
,
and APPEND_PARAM
. It defines how to handle if both uri
and params contains the same parameter.javax.portlet.PortletException
public static final java.net.URL getResource(javax.portlet.PortletContext ctx, java.lang.String uri) throws java.net.MalformedURLException
getRequestDispatcher(javax.portlet.PortletContext, java.lang.String, java.util.Map, int)
did.java.net.MalformedURLException
public static final java.io.InputStream getResourceAsStream(javax.portlet.PortletContext ctx, java.lang.String uri)
getRequestDispatcher(javax.portlet.PortletContext, java.lang.String, java.util.Map, int)
did.public static final java.lang.String generateURI(java.lang.String uri, java.util.Map params, int mode)
params
- the parameters to append to the query stringmode
- one of OVERWRITE_URI
, IGNORE_PARAM
,
and APPEND_PARAM
. It defines how to handle if both uri
and params contains the same parameter.
mode is used only if both uri contains query string and params is
not empty.Copyright © 2005-2011 Potix Corporation. All Rights Reserved.