From: Julien V. <ju...@jb...> - 2005-05-01 19:19:22
|
User: julien Date: 05/05/01 15:19:08 Modified: server/src/main/org/jboss/portal/server/impl/invocation PortalResponseImpl.java Log: back to relative URLs for PortletURL, added on JBossActionResponse and JBossRenderResponse a method to get the absolute URL Revision Changes Path 1.10 +18 -15 jboss-portal/server/src/main/org/jboss/portal/server/impl/invocation/PortalResponseImpl.java (In the diff below, changes in quantity of whitespace are not shown.) Index: PortalResponseImpl.java =================================================================== RCS file: /cvsroot/jboss/jboss-portal/server/src/main/org/jboss/portal/server/impl/invocation/PortalResponseImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -b -r1.9 -r1.10 --- PortalResponseImpl.java 18 Apr 2005 22:02:49 -0000 1.9 +++ PortalResponseImpl.java 1 May 2005 19:19:08 -0000 1.10 @@ -25,7 +25,7 @@ /** * @author <a href="mailto:ju...@jb...">Julien Viet</a> - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ public class PortalResponseImpl extends HttpServletResponseWrapper implements PortalResponse { @@ -49,12 +49,12 @@ this.invocation = invocation; } - public String createURL(ServerURL url) + public String createURL(ServerURL url, boolean relative) { - return createURL(url, null, null); + return createURL(url, null, null, relative); } - public String createURL(ServerURL url, Boolean wantAuthenticated, Boolean wantSecure) throws IllegalArgumentException + public String createURL(ServerURL url, Boolean wantAuthenticated, Boolean wantSecure, boolean relative) throws IllegalArgumentException { // Arg check if (url == null) @@ -85,10 +85,12 @@ Parameters controlParameters = url.getControlParameters(); // The URL - StringBuffer buffer = new StringBuffer(invocation.req.getScheme()).append("://"); + StringBuffer buffer = new StringBuffer(); // - buffer.append(invocation.req.getServerName()); + if (!relative) + { + buffer.append(invocation.req.getScheme()).append("://").append(invocation.req.getServerName()); // int port = invocation.req.getServerPort(); @@ -103,6 +105,7 @@ { buffer.append(":").append(port); } + } // Append the context path buffer.append(invocation.req.getContextPath()); |