You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2013/02/23 10:51:35 UTC

svn commit: r1449290 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java

Author: jleroux
Date: Sat Feb 23 09:51:34 2013
New Revision: 1449290

URL: http://svn.apache.org/r1449290
Log:
Still not sure why Eclipse complained about 
request.getSession().getServletContext()).getContextPath()

anyway
request.getContextPath()
is enough

see bottom of oracle.com/javaee/6/api/javax/servlet/ServletContext.html#method_detail

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java?rev=1449290&r1=1449289&r2=1449290&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java Sat Feb 23 09:51:34 2013
@@ -35,9 +35,9 @@ import javolution.util.FastList;
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.StringUtil;
+import org.ofbiz.base.util.StringUtil.StringWrapper;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.StringUtil.StringWrapper;
 import org.ofbiz.common.UrlServletHelper;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
@@ -342,7 +342,7 @@ public class CatalogUrlFilter extends Co
             GenericValue productCategory = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryId), true);
             CategoryContentWrapper wrapper = new CategoryContentWrapper(productCategory, request);
             List<String> trail = CategoryWorker.getTrail(request);
-            return makeCategoryUrl(delegator, wrapper, trail, request.getSession().getServletContext().getContextPath(), previousCategoryId, productCategoryId, productId, viewSize, viewIndex, viewSort, searchString);
+            return makeCategoryUrl(delegator, wrapper, trail, request.getContextPath(), previousCategoryId, productCategoryId, productId, viewSize, viewIndex, viewSort, searchString);
         } catch (GenericEntityException e) {
             Debug.logWarning(e, "Cannot create category's URL for: " + productCategoryId, module);
             return redirectUrl;
@@ -417,7 +417,7 @@ public class CatalogUrlFilter extends Co
             GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true);
             ProductContentWrapper wrapper = new ProductContentWrapper(product, request);
             List<String> trail = CategoryWorker.getTrail(request);
-            url = makeProductUrl(delegator, wrapper, trail, request.getSession().getServletContext().getContextPath(), previousCategoryId, productCategoryId, productId);
+            url = makeProductUrl(delegator, wrapper, trail, request.getContextPath(), previousCategoryId, productCategoryId, productId);
         } catch (GenericEntityException e) {
             Debug.logWarning(e, "Cannot create product's URL for: " + productId, module);
             return redirectUrl;