com.webmethods.caf.faces.bean.web
Class WebURLBean

java.lang.Object
  extended by com.webmethods.caf.faces.bean.web.WebURLBean
Direct Known Subclasses:
CurrentURLBean

public class WebURLBean
extends Object

Bean which can be used to build a generic url, using the bean's properties as request parameters. In addition to the bean's typed properties, parameters can be added to the bean dynamically via its urlParams map (see WebURLBean.getUrlParams()). All of the bean's properties, both typed and dynamic, must be of type String.


Field Summary
protected  Map m_params
           
protected  String m_path
           
 
Constructor Summary
WebURLBean()
          Creates a new bean with no base url (use WebURLBean.setUrlBase(java.lang.String) to set the base url).
WebURLBean(String url)
          Creates a new bean with the specified base url.
 
Method Summary
 String getUrl()
          Renders this bean to a url, using the properties of this bean as url parameters.
 Map getUrlParams()
          Request parameters of url.
 String getUrlPath()
          Path part of url.
 void redirect()
          Redirects the current faces request to this url.
 void setUrl(String url)
          Sets the state of this bean to match the specified url (clearing path and all old request parameters before setting new state).
 void setUrlBase(String url)
          Sets the state of this bean using the specified url (not clearing parameters left unspecified by url).
 void setUrlParams(Map params)
          Request parameters of url.
 void setUrlPath(String path)
          Path part of url.
 String toString()
          Renders this bean to a url, using the properties of this bean as url parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_path

protected String m_path

m_params

protected Map m_params
Constructor Detail

WebURLBean

public WebURLBean()
Creates a new bean with no base url (use WebURLBean.setUrlBase(java.lang.String) to set the base url).


WebURLBean

public WebURLBean(String url)
Creates a new bean with the specified base url.

Method Detail

toString

public String toString()
Renders this bean to a url, using the properties of this bean as url parameters.

Overrides:
toString in class Object

redirect

public void redirect()
              throws IOException
Redirects the current faces request to this url.

Throws:
IOException

getUrl

public String getUrl()
Renders this bean to a url, using the properties of this bean as url parameters.


setUrl

public void setUrl(String url)
Sets the state of this bean to match the specified url (clearing path and all old request parameters before setting new state).


getUrlPath

public String getUrlPath()
Path part of url.


setUrlPath

public void setUrlPath(String path)
Path part of url.


getUrlParams

public Map getUrlParams()
Request parameters of url. This map represents both the typed properties of this bean, as well as any properties added dynamically to this map.


setUrlParams

public void setUrlParams(Map params)
Request parameters of url. This map represents both the typed properties of this bean, as well as any properties added dynamically to this map.


setUrlBase

public void setUrlBase(String url)
Sets the state of this bean using the specified url (not clearing parameters left unspecified by url).