Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
535 posts
|
Author: sascharodekamp
Date: Tue Mar 6 12:23:36 2012 New Revision: 1297442 URL: http://svn.apache.org/viewvc?rev=1297442&view=rev Log: Revert r1297030 because the encoding makes a problem with redirecting from HTTP to HTTPS Modified: ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Modified: ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1297442&r1=1297441&r2=1297442&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original) +++ ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Tue Mar 6 12:23:36 2012 @@ -24,8 +24,6 @@ import java.io.IOException; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.Charset; import java.security.cert.X509Certificate; import java.util.List; import java.util.Locale; @@ -1081,12 +1079,7 @@ public class RequestHandler { newURL.insert(questionIndex, sessionId); } } - try { - encodedUrl = URLEncoder.encode(newURL.toString(), Charset.forName("UTF-8").displayName()); - } catch (UnsupportedEncodingException e) { - Debug.logError(e, module); - encodedUrl = newURL.toString(); - } + encodedUrl = newURL.toString(); } } else { encodedUrl = newURL.toString(); Modified: ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/WidgetWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=1297442&r1=1297441&r2=1297442&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original) +++ ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Tue Mar 6 12:23:36 2012 @@ -20,10 +20,7 @@ package org.ofbiz.widget; import java.io.IOException; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.math.BigDecimal; -import java.net.URLEncoder; -import java.nio.charset.Charset; import java.text.DateFormat; import java.util.List; import java.util.Map; @@ -319,14 +316,9 @@ public class WidgetWorker { public String getValue(Map<String, Object> context) { if (this.value != null) { - try { - return URLEncoder.encode(this.value.expandString(context), Charset.forName("UTF-8").displayName()); - } catch (UnsupportedEncodingException e) { - Debug.logError(e, module); - return this.value.expandString(context); - } + return this.value.expandString(context); } - + Object retVal = null; if (this.fromField != null && this.fromField.get(context) != null) { retVal = this.fromField.get(context); @@ -337,7 +329,7 @@ public class WidgetWorker { if (retVal != null) { TimeZone timeZone = (TimeZone) context.get("timeZone"); if (timeZone == null) timeZone = TimeZone.getDefault(); - + String returnValue = null; // format string based on the user's time zone (not locale because these are parameters) if (retVal instanceof Double || retVal instanceof Float || retVal instanceof BigDecimal) { @@ -355,11 +347,7 @@ public class WidgetWorker { DateFormat df = UtilDateTime.toDateTimeFormat("EEE MMM dd hh:mm:ss z yyyy", timeZone, null); returnValue = df.format((java.util.Date) retVal); } else { - try { - returnValue = URLEncoder.encode(retVal.toString(), Charset.forName("UTF-8").displayName()); - } catch (UnsupportedEncodingException e) { - Debug.logError(e, module); - } + returnValue = retVal.toString(); } return returnValue; } else { @@ -390,7 +378,7 @@ public class WidgetWorker { /** Returns the script location based on a script combined name: * <code>location#methodName</code>. - * + * * @param combinedName The combined location/method name * @return The script location */ @@ -405,7 +393,7 @@ public class WidgetWorker { /** Returns the script method name based on a script combined name: * <code>location#methodName</code>. Returns <code>null</code> if * no method name is found. - * + * * @param combinedName The combined location/method name * @return The method name or <code>null</code> */ |
Free forum by Nabble | Edit this page |