"portlet:resource?_jsfBridgeViewId=/tests/SingleRequestTest.jsp&param1=value1&param2=value2";
FacesContext ctx = FacesContext.getCurrentInstance();
ExternalContext extCtx = ctx.getExternalContext();
MimeResponse response = (MimeResponse) extCtx.getResponse();
ResourceURL portletURL = response.createResourceURL();
portletURL.setParameter("_jsfBridgeViewId", "/tests/SingleRequestTest.jsp");
portletURL.setParameter("param1", "value1");
portletURL.setParameter("param2", "value2");
StringWriter sw = new StringWriter(50);
String portletEncoded = null;
try {
portletURL.write(sw, true);
portletEncoded = sw.toString();
} catch (Exception e)
{
portletEncoded = portletURL.toString();
}
// PortletContainers can return "URLs" with strict XML encoding -- as the bridge
// encoding depends on what is past in to it -- make sure we send in a string
// with the same encoding as compare string.