// (interaction
// state)
MimeResponse mimeResponse = (MimeResponse) getResponse();
PortletURL actionURL = null;
ResourceURL resourceURL = null;
BaseURL baseURL = null;
// Non-JSF actions are renderURLs as we merely dispatch to them
if (nonFacesAction)
{
if (isPortletURL && urlType == Bridge.PortletPhase.ACTION_PHASE)
{
baseURL = actionURL = mimeResponse.createActionURL();
}
else if (isPortletURL && urlType == Bridge.PortletPhase.RESOURCE_PHASE)
{
baseURL = resourceURL = mimeResponse.createResourceURL();
}
else
{
baseURL = actionURL = mimeResponse.createRenderURL();
}
}
else
{
baseURL = actionURL = mimeResponse.createActionURL();
}
// Add parameters so they don't get lost
Enumeration<String> list = queryStr.getParameterNames();
while (list.hasMoreElements())
{
String param = list.nextElement().toString();
if (actionURL != null && param.equals(Bridge.PORTLET_MODE_PARAMETER))
{
try
{
actionURL.setPortletMode(new PortletMode(queryStr.getParameter(param)));
}
catch (Exception e)
{
; // do nothing -- just ignore
}
}
else if (actionURL != null && param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
{
try
{
actionURL.setWindowState(new WindowState(queryStr.getParameter(param)));
}
catch (Exception e)
{
; // do nothing -- just ignore
}
}
else if (param.equals(Bridge.PORTLET_SECURE_PARAMETER))
{
try
{
baseURL.setSecure(Boolean.getBoolean(queryStr.getParameter(param)));
}
catch (Exception e)
{
; // do nothing -- just ignore
}
}
else
{
baseURL.setParameter(param, queryStr.getParameter(param));
}
}
// Some portlet containers implementing wsrp choose to separate the
// consumer rewrite string that represents this URL using & as the
// spec allows for either that or &. If the container has chosen to
// to do such -- undo it (use & instead) as faces renderkits/response writers
// may reencode when writing XMl content.
url = baseURL.toString();
url = url.replaceAll("\\&\\;", "&");
}
else if (getPortletPhase() == Bridge.PortletPhase.ACTION_PHASE ||
getPortletPhase() == Bridge.PortletPhase.EVENT_PHASE)
{ // action - write the viewId to navigational state