//
String actionURL = facesContext.getApplication().getViewHandler()
.getActionURL(facesContext, viewId);
actionURL = facesContext.getExternalContext().encodeActionURL(
actionURL);
windowState.setPortalActionURL(new PortalActionURL(actionURL));
PortletURL portletURL = wrappedResponse.createRenderURL();
portletURL.setParameter(PortletStateHolder.STATE_ID_PARAMETER,
stateId.toString());
String renderUrl = portletURL.toString();
windowState.setPortalRenderURL(new PortalActionURL(renderUrl));
windowState.setNamespace(namespace);
windowState.setPortletLocale(request.getLocale());
// TODO - encode request attributes, portlet mode and windowId, as
// required by JSR-301 5.3.3
String portletModeName = request.getPortletMode().toString();
PortalActionURL historyViewId = new PortalActionURL(viewId);
historyViewId.setParameter(PortletStateHolder.STATE_ID_PARAMETER,
stateId.toString());
historyViewId.setParameter(Bridge.PORTLET_MODE_PARAMETER,
portletModeName);
facesContext.getExternalContext().getSessionMap().put(
VIEWID_HISTORY_PREFIX + portletModeName,
historyViewId.toString());
// writer.println("</div>");
windowState.saveSeamConversationId(facesContext);
// PortletSession portletSession = request.getPortletSession(true);
PortletSession portletSession = (PortletSession) facesContext
.getExternalContext().getSession(true);