You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2009/06/29 05:22:04 UTC

svn commit: r789201 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/ContentUrlTag.java

Author: doogie
Date: Mon Jun 29 03:22:03 2009
New Revision: 789201

URL: http://svn.apache.org/viewvc?rev=789201&view=rev
Log:
Add a variant of appendContentPrefix that takes an Appendable.

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/ContentUrlTag.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/ContentUrlTag.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/ContentUrlTag.java?rev=789201&r1=789200&r2=789201&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/ContentUrlTag.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/taglib/ContentUrlTag.java Mon Jun 29 03:22:03 2009
@@ -40,12 +40,22 @@
 
     @Deprecated
     public static void appendContentPrefix(HttpServletRequest request, StringBuffer urlBuffer) {
-        StringBuilder urlBuilder = new StringBuilder();
-        appendContentPrefix(request, urlBuilder);
-        urlBuffer.append(urlBuilder);
+        try {
+            appendContentPrefix(request, (Appendable) urlBuffer);
+        } catch (IOException e) {
+            throw (InternalError) new InternalError(e.getMessage()).initCause(e);
+        }
     }
 
     public static void appendContentPrefix(HttpServletRequest request, StringBuilder urlBuffer) {
+        try {
+            appendContentPrefix(request, (Appendable) urlBuffer);
+        } catch (IOException e) {
+            throw (InternalError) new InternalError(e.getMessage()).initCause(e);
+        }
+    }
+
+    public static void appendContentPrefix(HttpServletRequest request, Appendable urlBuffer) throws IOException {
         if (request == null) {
             Debug.logWarning("WARNING: request was null in appendContentPrefix; this probably means this was used where it shouldn't be, like using ofbizContentUrl in a screen rendered through a service; using best-bet behavior: standard prefix from url.properties (no WebSite or security setting known)", module);
             String prefix = UtilProperties.getPropertyValue("url", "content.url.prefix.standard");