rogerrut 2004/12/20 17:25:43 Modified: components/web-content/src/java/org/apache/jetspeed/portlet WebContentPortlet.java Log: Cleanup and using preference instead of INIT-PARAM for SRC Revision Changes Path 1.10 +6 -13 jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/WebContentPortlet.java Index: WebContentPortlet.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/WebContentPortlet.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- WebContentPortlet.java 9 Dec 2004 22:57:02 -0000 1.9 +++ WebContentPortlet.java 21 Dec 2004 01:25:43 -0000 1.10 @@ -20,6 +20,7 @@ import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletConfig; +import javax.portlet.PortletContext; import javax.portlet.PortletException; import javax.portlet.PortletMode; import javax.portlet.PortletPreferences; @@ -132,9 +133,6 @@ { super.init(config); - defaultViewSource = config.getInitParameter(VIEW_SOURCE_PARAM); - if (defaultViewSource == null) defaultViewSource = "http://www.apache.org"; - defaultEditSource = config.getInitParameter(EDIT_SOURCE_PARAM); } @@ -214,7 +212,7 @@ if (sourceURL == null) { // Use the URL defined in the preferences - sourceURL = defaultViewSource; + sourceURL = request.getPreferences().getValue("SRC", ""); } if (lastURL != null && sourceURL.equals(lastURL)) @@ -230,14 +228,9 @@ // Initialize the controller if it's not already done if (rewriteController == null) { - // Extract context path - String pathTranslated = ((HttpServletRequest) ((HttpServletRequestWrapper) request).getRequest()) - .getPathTranslated(); - String contextPath = request.getContextPath(); - - contextPath = pathTranslated.substring(0, pathTranslated.indexOf("webapps") + 7) + contextPath - + "/WEB-INF/"; - + PortletContext portletApplication = getPortletContext(); + String path = portletApplication.getRealPath("/WEB-INF"); + String contextPath = path + "/"; try { // Create rewriter adaptor
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]