freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [3/5] incubator-freemarker git commit: FREEMARKER-55: specifying encoding exception
Date Tue, 19 Sep 2017 06:03:56 GMT
FREEMARKER-55: specifying encoding exception


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/b8dcdc0a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/b8dcdc0a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/b8dcdc0a

Branch: refs/heads/3
Commit: b8dcdc0aaca5112f193cbb78c0e062b05f2f15ed
Parents: 8837a92
Author: Woonsan Ko <woonsan@apache.org>
Authored: Mon Sep 18 10:18:48 2017 -0400
Committer: Woonsan Ko <woonsan@apache.org>
Committed: Mon Sep 18 10:18:48 2017 -0400

----------------------------------------------------------------------
 .../spring/model/AbstractSpringTemplateCallableModel.java   | 2 +-
 .../org/apache/freemarker/spring/model/MessageFunction.java | 2 +-
 .../org/apache/freemarker/spring/model/UrlFunction.java     | 9 ++++++---
 3 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b8dcdc0a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/AbstractSpringTemplateCallableModel.java
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/AbstractSpringTemplateCallableModel.java
b/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/AbstractSpringTemplateCallableModel.java
index d6157b0..d97e750 100644
--- a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/AbstractSpringTemplateCallableModel.java
+++ b/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/AbstractSpringTemplateCallableModel.java
@@ -102,7 +102,7 @@ abstract class AbstractSpringTemplateCallableModel implements TemplateCallableMo
 
         if (rcModel == null) {
             throw CallableUtils.newGenericExecuteException(
-                    AbstractTemplateView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE + " not found.",
this, false);
+                    AbstractTemplateView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE + " is not
found.", this, false);
         }
 
         RequestContext requestContext = (RequestContext) getObjectWrapperAndUnwrapper(env,
calledAsFunction)

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b8dcdc0a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/MessageFunction.java
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/MessageFunction.java
b/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/MessageFunction.java
index c6ac520..e387a20 100644
--- a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/MessageFunction.java
+++ b/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/MessageFunction.java
@@ -103,7 +103,7 @@ class MessageFunction extends AbstractSpringTemplateFunctionModel {
         final MessageSource messageSource = getMessageSource(requestContext);
 
         if (messageSource == null) {
-            throw CallableUtils.newGenericExecuteException("MessageSource not found.", this);
+            throw CallableUtils.newGenericExecuteException("MessageSource not found from
the request context.", this);
         }
 
         String message = null;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/b8dcdc0a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/UrlFunction.java
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/UrlFunction.java
b/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/UrlFunction.java
index a2c8f72..0198eaf 100644
--- a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/UrlFunction.java
+++ b/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/UrlFunction.java
@@ -219,7 +219,8 @@ class UrlFunction extends AbstractSpringTemplateFunctionModel {
                 try {
                     uri = uri.replace(template, UriUtils.encodePath(paramValue, encoding));
                 } catch (UnsupportedEncodingException e) {
-                    throw CallableUtils.newGenericExecuteException("Cannot encode URI. "
+ e, this);
+                    throw CallableUtils.newGenericExecuteException("Unsupported servlet response
encoding: " + encoding,
+                            this);
                 }
             } else {
                 template = URL_TEMPLATE_DELIMITER_PREFIX + '/' + paramName + URL_TEMPLATE_DELIMITER_SUFFIX;
@@ -230,7 +231,8 @@ class UrlFunction extends AbstractSpringTemplateFunctionModel {
                     try {
                         uri = uri.replace(template, UriUtils.encodePathSegment(paramValue,
encoding));
                     } catch (UnsupportedEncodingException e) {
-                        throw CallableUtils.newGenericExecuteException("Cannot encode URI.
" + e, this);
+                        throw CallableUtils
+                                .newGenericExecuteException("Unsupported servlet response
encoding: " + encoding, this);
                     }
                 }
             }
@@ -263,7 +265,8 @@ class UrlFunction extends AbstractSpringTemplateFunctionModel {
                         queryStringBuilder.append(UriUtils.encodeQueryParam(paramValue, encoding));
                     }
                 } catch (UnsupportedEncodingException e) {
-                    throw CallableUtils.newGenericExecuteException("Cannot encode query parameter.
" + e, this);
+                    throw CallableUtils.newGenericExecuteException("Unsupported servlet response
encoding: " + encoding,
+                            this);
                 }
             }
         }


Mime
View raw message