You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/10/02 16:01:49 UTC

svn commit: r581244 - /lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java

Author: andreas
Date: Tue Oct  2 07:01:49 2007
New Revision: 581244

URL: http://svn.apache.org/viewvc?rev=581244&view=rev
Log:
Obtain context path only if necessary

Modified:
    lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java

Modified: lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java
URL: http://svn.apache.org/viewvc/lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java?rev=581244&r1=581243&r2=581244&view=diff
==============================================================================
--- lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java (original)
+++ lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java Tue Oct  2 07:01:49 2007
@@ -61,7 +61,7 @@
         URLInformation info = new URLInformation(webappUrl);
         String pubId = info.getPublicationId();
         String area = info.getArea();
-        
+
         String proxyUrl = null;
 
         if (pubId != null && area != null) {
@@ -70,7 +70,6 @@
                 contextUtil = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
                 Request request = ObjectModelHelper.getRequest(contextUtil.getObjectModel());
                 Context context = ObjectModelHelper.getContext(contextUtil.getObjectModel());
-                String contextPath = request.getContextPath();
                 String servletContextPath = context.getRealPath("");
                 Publication pub = PublicationFactory.getPublication(pubId, servletContextPath);
 
@@ -81,7 +80,7 @@
                     if (proxy != null) {
                         proxyUrl = proxy.getURL(doc);
                     } else {
-                    		webappUrl = contextPath + webappUrl;
+                        webappUrl = request.getContextPath() + webappUrl;
                     }
                 }
 
@@ -93,7 +92,7 @@
                 }
             }
         }
-        
+
         return proxyUrl != null ? proxyUrl : webappUrl;
 
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org