public int getServerPort() { return _req.getServerPort(); }
logger.debug("Processing portal render request " + req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/" + req.getContextPath() + " (scriptUrl=" + scriptUrl + ")");
logger.debug("Processing portal render request " + req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/" + req.getContextPath() + " (scriptUrl=" + scriptUrl + ")");
logger.debug("Processing portal render request " + req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + "/" + req.getContextPath() + " (scriptUrl=" + scriptUrl + ")");
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; }
Attributes.SERVER_PORT.getName(), Collections.singletonList( Integer.valueOf(renderRequest.getServerPort()).toString())); attributes.put( Attributes.SECURE.getName(),
Attributes.SERVER_PORT.getName(), Collections.singletonList( Integer.valueOf(renderRequest.getServerPort()).toString())); attributes.put( Attributes.SECURE.getName(),
renderRequest.setAttribute("serverPort", Integer.valueOf(renderRequest.getServerPort()));