public String getURLSource(RenderRequest request, RenderResponse response, PortletPreferences prefs) { String [] srcReplaceValues = { request.getServerName(), Integer.toString(request.getServerPort()), request.getContextPath() }; String source = (String) PortletMessaging.receive(request, IFRAME_SRC_URL); if (source == null) { source = StringUtils.replaceEach(getAttributePreference(prefs, "SRC"), SRC_REPLACE_KEYS, srcReplaceValues); } // Sometimes, iframe's SRC attribute can be set to a local url to allow cross-domain scripting. // If proxy remote URL and its corresponding local path are set, then the proxy remote URL prefix // should be replaced by the local path. String proxyRemoteURL = StringUtils.replaceEach(getAttributePreference(prefs, "PROXYREMOTEURL"), SRC_REPLACE_KEYS, srcReplaceValues); String proxyLocalPath = StringUtils.replaceEach(getAttributePreference(prefs, "PROXYLOCALPATH"), SRC_REPLACE_KEYS, srcReplaceValues); if (StringUtils.isNotEmpty(proxyRemoteURL) && StringUtils.isNotEmpty(proxyLocalPath) && StringUtils.startsWith(source, proxyRemoteURL)) { source = proxyLocalPath + source.substring(proxyRemoteURL.length()); } return source; }
public String getURLSource(RenderRequest request, RenderResponse response, PortletPreferences prefs) { String [] srcReplaceValues = { request.getServerName(), Integer.toString(request.getServerPort()), request.getContextPath() }; String source = (String) PortletMessaging.receive(request, IFRAME_SRC_URL); if (source == null) { source = StringUtils.replaceEach(getAttributePreference(prefs, "SRC"), SRC_REPLACE_KEYS, srcReplaceValues); } // Sometimes, iframe's SRC attribute can be set to a local url to allow cross-domain scripting. // If proxy remote URL and its corresponding local path are set, then the proxy remote URL prefix // should be replaced by the local path. String proxyRemoteURL = StringUtils.replaceEach(getAttributePreference(prefs, "PROXYREMOTEURL"), SRC_REPLACE_KEYS, srcReplaceValues); String proxyLocalPath = StringUtils.replaceEach(getAttributePreference(prefs, "PROXYLOCALPATH"), SRC_REPLACE_KEYS, srcReplaceValues); if (StringUtils.isNotEmpty(proxyRemoteURL) && StringUtils.isNotEmpty(proxyLocalPath) && StringUtils.startsWith(source, proxyRemoteURL)) { source = proxyLocalPath + source.substring(proxyRemoteURL.length()); } return source; }
Cookie[] cookies = (Cookie[])PortletMessaging.receive(request, HTTP_STATE); if (cookies != null)
List<Cookie> cookies = (List<Cookie>) PortletMessaging.receive(request, HTTP_STATE);
WebContentPageHistory history = (WebContentPageHistory)PortletMessaging.receive(request, HISTORY);
WebContentHistoryList history = (WebContentHistoryList)PortletMessaging.receive(request, HISTORY); if (history == null) history = new WebContentHistoryList();