org.rhq.enterprise.gui.legacy.util
Class ActionUtils

java.lang.Object
  extended by org.rhq.enterprise.gui.legacy.util.ActionUtils

public class ActionUtils
extends Object

Utilities class that provides general convenience methods.


Constructor Summary
ActionUtils()
           
 
Method Summary
static org.apache.struts.action.ActionForward changeForwardPath(org.apache.struts.action.ActionForward forward, Map params)
          Return a new ActionForward based on the given one but with the specified parameter name and value added to the new forward's path.
static org.apache.struts.action.ActionForward changeForwardPath(org.apache.struts.action.ActionForward forward, String param, String value)
           
static String changeUrl(String url, Map params)
          Change a url by appending all of the params to it.
static String findReturnPath(org.apache.struts.action.ActionMapping mapping, Map params)
          Return a URL path that will return control to the current action.
static String findReturnPath(org.apache.struts.action.ActionMapping mapping, String param, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionUtils

public ActionUtils()
Method Detail

changeForwardPath

public static org.apache.struts.action.ActionForward changeForwardPath(org.apache.struts.action.ActionForward forward,
                                                                       Map params)
                                                                throws Exception
Return a new ActionForward based on the given one but with the specified parameter name and value added to the new forward's path. NOTE: this method would be unnecessary if Struts allowed us to "unfreeze" the ForwardConfig that is the superclass of the forward.

Parameters:
forward - the ActionForward on which the new forward is based
param - the name of the path parameter to add
value - the value of the parameter to add
Throws:
javax.servlet.ServletException - if encoding the path parameter fails
Exception

changeForwardPath

public static org.apache.struts.action.ActionForward changeForwardPath(org.apache.struts.action.ActionForward forward,
                                                                       String param,
                                                                       String value)
                                                                throws Exception
Throws:
Exception

changeUrl

public static String changeUrl(String url,
                               Map params)
                        throws Exception
Change a url by appending all of the params to it.

Parameters:
url - the original URL
params - the name-value pairs to append
Returns:
the new url
Throws:
Exception

findReturnPath

public static String findReturnPath(org.apache.struts.action.ActionMapping mapping,
                                    Map params)
                             throws Exception
Return a URL path that will return control to the current action. This path is generated by adding the specified parameters to the path of the forward specified as the "input" forward for the given mapping.

Parameters:
mapping - the ActionMapping describing the current action's forwards
params - a map containing the path parameters to add
Throws:
javax.servlet.ServletException - if encoding the path parameter fails or input has not been set
Exception

findReturnPath

public static String findReturnPath(org.apache.struts.action.ActionMapping mapping,
                                    String param,
                                    String value)
                             throws Exception
Throws:
Exception


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.