|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.utils.URLUtil
public class URLUtil
The URLUtil class offers static helper methods for manipulating the request parameters and URLs of both HTTP GET and HTTP POST requests and performing redirections based on the new parameters and URLs. and request parameters.
Field Summary | |
---|---|
static java.lang.String |
HTTP_GET_REQUEST
|
static java.lang.String |
HTTP_POST_REQUEST
|
private static org.apache.commons.logging.Log |
log
|
static int |
REDIRECT_URL_LIMIT
|
Constructor Summary | |
---|---|
URLUtil()
|
Method Summary | |
---|---|
private static void |
buildHeader(javax.servlet.http.HttpServletRequest req,
java.net.HttpURLConnection uconn)
|
private static java.lang.String |
buildRequestParams(javax.servlet.http.HttpServletRequest req,
java.lang.String[] ignoreParams)
Uses an HttpServletRequest object and a String array that contains the names of parameters to be ignored to construct a filtered name-value pair string. |
private static UPFileSpec |
buildUPFileSpec(java.lang.String targetNodeId,
java.lang.String extras,
boolean asRoot)
Constructs a generic UPFileSpec object using the specified target node id. |
private static boolean |
parameterExistsIn(java.lang.String param,
java.lang.String[] params)
Determines if the specified parameter exists within the specified String array. |
static void |
redirect(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.lang.String targetNodeId,
boolean asRoot,
java.lang.String[] ignoreParams,
java.lang.String charset)
Performs a redirect for both HTTP GET and HTTP POST requests based on the the specified target channel and parameters to be ignored. |
static void |
redirectGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
UPFileSpec up,
java.lang.String[] ignoreParams)
Performs a HTTP GET redirect using the specified UPFileSpec and parameters to be ignored. |
static void |
redirectPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
UPFileSpec up,
java.lang.String[] ignoreParams,
java.lang.String charset)
Performs a HTTP POST redirect using the specified UPFileSpec and parameters to be ignored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
public static final int REDIRECT_URL_LIMIT
public static final java.lang.String HTTP_GET_REQUEST
public static final java.lang.String HTTP_POST_REQUEST
Constructor Detail |
---|
public URLUtil()
Method Detail |
---|
public static void redirect(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String targetNodeId, boolean asRoot, java.lang.String[] ignoreParams, java.lang.String charset) throws PortalException
req
- An HttpServletRequest object.res
- An HttpServletResponse object.targetNodeId
- The target node Id of a channel.ignoreParams
- An array of String objects containing
the parameters to be ignored.
PortalException
private static java.lang.String buildRequestParams(javax.servlet.http.HttpServletRequest req, java.lang.String[] ignoreParams)
req
- A HttpServletRequest object.ignoreParams
- An array of String objects representing
the parameters to be ignored.
private static boolean parameterExistsIn(java.lang.String param, java.lang.String[] params)
param
- The parameter name to search for in the array of parameters.params
- The array of parameters to search in.
private static UPFileSpec buildUPFileSpec(java.lang.String targetNodeId, java.lang.String extras, boolean asRoot) throws PortalException
targetNodeId
- The target node id to be used in the
UPFileSpec object.
PortalException
public static void redirectGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, UPFileSpec up, java.lang.String[] ignoreParams) throws PortalException
req
- An HttpServletRequest object.res
- An HttpServletResponse object.up
- the uPortal file spec.ignoreParams
- An array of String objects containing
the parameters to be ignored.
PortalException
private static void buildHeader(javax.servlet.http.HttpServletRequest req, java.net.HttpURLConnection uconn)
public static void redirectPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, UPFileSpec up, java.lang.String[] ignoreParams, java.lang.String charset) throws PortalException
req
- An HttpServletRequest object.res
- An HttpServletResponse object.up
- the uPortal file spec.ignoreParams
- An array of String objects containing
the parameters to be ignored.
PortalException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |