Author: adrianc Date: Thu Oct 24 01:51:48 2013 New Revision: 1535262 URL: http://svn.apache.org/r1535262 Log: Updated OfbizCatalogAltUrlTransform.java to use the new OFBiz URL builder.
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/OfbizCatalogAltUrlTransform.java Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/OfbizCatalogAltUrlTransform.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/OfbizCatalogAltUrlTransform.java?rev=1535262&r1=1535261&r2=1535262&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/OfbizCatalogAltUrlTransform.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/OfbizCatalogAltUrlTransform.java Thu Oct 24 01:51:48 2013 @@ -27,14 +27,14 @@ import javax.servlet.http.HttpServletReq import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; - import org.ofbiz.base.util.template.FreeMarkerWorker; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.product.product.ProductContentWrapper; import org.ofbiz.service.LocalDispatcher; -import org.ofbiz.webapp.control.RequestHandler; +import org.ofbiz.webapp.OfbizUrlBuilder; +import org.ofbiz.webapp.control.WebAppConfigurationException; import freemarker.core.Environment; import freemarker.ext.beans.BeanModel; @@ -121,8 +121,8 @@ public class OfbizCatalogAltUrlTransform } // make the link if (fullPath){ - String serverRootUrl = RequestHandler.getDefaultServerRootUrl(request, secure); - newURL.append(serverRootUrl); + OfbizUrlBuilder builder = OfbizUrlBuilder.from(request); + builder.buildHostPart(newURL, url, secure); } newURL.append(url); out.write(newURL.toString()); @@ -147,6 +147,8 @@ public class OfbizCatalogAltUrlTransform throw new IOException(e.getMessage()); } catch (GenericEntityException e) { throw new IOException(e.getMessage()); + } catch (WebAppConfigurationException e) { + throw new IOException(e.getMessage()); } } };