freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject [11/13] incubator-freemarker git commit: FREEMARKER-55: exposing form model directly
Date Thu, 04 Jan 2018 19:49:34 GMT
FREEMARKER-55: exposing form model directly


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

Branch: refs/heads/3
Commit: fdbeb1c6e4109480785797dd4938f7d7d47b89e2
Parents: 2ffeeae
Author: Woonsan Ko <woonsan@apache.org>
Authored: Thu Jan 4 14:26:00 2018 -0500
Committer: Woonsan Ko <woonsan@apache.org>
Committed: Thu Jan 4 14:26:00 2018 -0500

----------------------------------------------------------------------
 .../freemarker/spring/model/SpringTemplateCallableHashModel.java | 3 ---
 .../org/apache/freemarker/spring/web/view/FreeMarkerView.java    | 4 ++++
 .../views/test/model/form/form-directive-usages.ftlh             | 2 --
 .../views/test/model/form/input-directive-usages.ftlh            | 2 --
 4 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/fdbeb1c6/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/SpringTemplateCallableHashModel.java
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/SpringTemplateCallableHashModel.java
b/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/SpringTemplateCallableHashModel.java
index a859821..ad74823 100644
--- a/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/SpringTemplateCallableHashModel.java
+++ b/freemarker-spring/src/main/java/org/apache/freemarker/spring/model/SpringTemplateCallableHashModel.java
@@ -30,7 +30,6 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateHashModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateStringModel;
-import org.apache.freemarker.spring.model.form.SpringFormTemplateCallableHashModel;
 
 /**
  * TemplateHashModel wrapper for templates using Spring directives, functions and internal
models.
@@ -67,8 +66,6 @@ public final class SpringTemplateCallableHashModel implements TemplateHashModel,
         modelsMap.put(TransformFunction.NAME, new TransformFunction(request, response));
         modelsMap.put(UrlFunction.NAME, new UrlFunction(request, response));
         modelsMap.put(EvalFunction.NAME, new EvalFunction(request, response));
-
-        modelsMap.put(SpringFormTemplateCallableHashModel.NAME, new SpringFormTemplateCallableHashModel(request,
response));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/fdbeb1c6/freemarker-spring/src/main/java/org/apache/freemarker/spring/web/view/FreeMarkerView.java
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/main/java/org/apache/freemarker/spring/web/view/FreeMarkerView.java
b/freemarker-spring/src/main/java/org/apache/freemarker/spring/web/view/FreeMarkerView.java
index c8fcbd2..8689522 100644
--- a/freemarker-spring/src/main/java/org/apache/freemarker/spring/web/view/FreeMarkerView.java
+++ b/freemarker-spring/src/main/java/org/apache/freemarker/spring/web/view/FreeMarkerView.java
@@ -36,6 +36,7 @@ import org.apache.freemarker.servlet.IncludePage;
 import org.apache.freemarker.servlet.ServletContextHashModel;
 import org.apache.freemarker.servlet.jsp.TaglibFactory;
 import org.apache.freemarker.spring.model.SpringTemplateCallableHashModel;
+import org.apache.freemarker.spring.model.form.SpringFormTemplateCallableHashModel;
 
 /**
  * FreeMarker template based view implementation, with being able to provide a {@link ServletContextHashModel}
@@ -141,6 +142,9 @@ public class FreeMarkerView extends AbstractFreeMarkerView {
         model.putUnlistedModel(SpringTemplateCallableHashModel.NAME,
                 new SpringTemplateCallableHashModel(request, response));
 
+        model.putUnlistedModel(SpringFormTemplateCallableHashModel.NAME,
+                new SpringFormTemplateCallableHashModel(request, response));
+
         model.putAll(map);
 
         return model;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/fdbeb1c6/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/form-directive-usages.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/form-directive-usages.ftlh
b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/form-directive-usages.ftlh
index f70a4aa..bfd65cd 100644
--- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/form-directive-usages.ftlh
+++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/form-directive-usages.ftlh
@@ -19,8 +19,6 @@
 <html>
 <body>
 
-  <#assign form=spring.form />
-
   <h1>Form 1</h1>
   <hr/>
   <@form.form "user" id="form1">

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/fdbeb1c6/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/input-directive-usages.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/input-directive-usages.ftlh
b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/input-directive-usages.ftlh
index b575ea0..aa95a0d 100644
--- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/input-directive-usages.ftlh
+++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/form/input-directive-usages.ftlh
@@ -19,8 +19,6 @@
 <html>
 <body>
 
-  <#assign form=spring.form />
-
   <h1>Form 1</h1>
   <hr/>
   <form id="form1">


Mime
View raw message