freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [3/9] incubator-freemarker git commit: FREEMARKER-55: simplifying test examples with no interim vars
Date Thu, 14 Sep 2017 09:14:12 GMT
FREEMARKER-55: simplifying test examples with no interim vars


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

Branch: refs/heads/3
Commit: f6abc3054e1fb571c221d874c2c2ed37bb8ecf7c
Parents: 3f6ee18
Author: Woonsan Ko <woonsan@apache.org>
Authored: Wed Sep 13 12:21:10 2017 -0400
Committer: Woonsan Ko <woonsan@apache.org>
Committed: Wed Sep 13 12:21:10 2017 -0400

----------------------------------------------------------------------
 .../test/model/eval-function-basic-usages.ftl   | 15 +++++---------
 .../test/model/url-function-basic-usages.ftl    | 21 +++++++-------------
 2 files changed, 12 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/f6abc305/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftl
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftl
b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftl
index b5b1dd6..2498b5f 100644
--- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftl
+++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftl
@@ -20,26 +20,21 @@
 <html>
 <body>
 
-<#assign expression="T(java.lang.Math).max(12.34, 56.78)" />
-<div id="maxNumber">${spring.eval(expression)}</div>
+<div id="maxNumber">${spring.eval("T(java.lang.Math).max(12.34, 56.78)")}</div>
 
 <ul>
   <#list users as user>
     <li>
-      <#assign expression="user.id" />
-      <div id="user-${spring.eval(expression)!}">
-        <#assign expression="user.firstName + ' ' + user.lastName" />
-        ${spring.eval(expression)!}
+      <div id="user-${spring.eval('user.id')!}">
+        ${spring.eval("user.firstName + ' ' + user.lastName")!}
       </div>
     </li>
   </#list>
 </ul>
 
-<#assign expression="users[0].id" />
-<div id="firstUserId">${spring.eval(expression)!}</div>
+<div id="firstUserId">${spring.eval("users[0].id")!}</div>
 
-<#assign expression="{0,1,1,2,3,5,8,13}" />
-<#assign numbers=spring.eval(expression) />
+<#assign numbers=spring.eval("{0,1,1,2,3,5,8,13}") />
 <div id="fibonacci"><#list numbers as number>${number}<#sep>, </#list></div>
 
 </body>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/f6abc305/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftl
----------------------------------------------------------------------
diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftl
b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftl
index 870ba3c..cd8ff79 100644
--- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftl
+++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftl
@@ -21,41 +21,34 @@
 <body>
 
 <h2 id="usersListHeader">
-  <#assign pathInfo="/users/" />
-  <a href="${spring.url(pathInfo)}">Users List</a>
+  <a href="${spring.url('/users/')}">Users List</a>
 </h2>
 
 <h3 id="usersListHeaderWithSortParams">
-  <#assign pathInfo="/users/" />
-  <a href="${spring.url(pathInfo, sortField='birthDate', sortDirection='descending')}">Users
List</a>
+  <a href="${spring.url('/users/', sortField='birthDate', sortDirection='descending')}">Users
List</a>
 </h3>
 
 <h2 id="otherAppsUsersListHeader">
-  <#assign pathInfo="/users/" />
-  <a href="${spring.url(pathInfo, context='/otherapp')}">Users List</a>
+  <a href="${spring.url('/users/', context='/otherapp')}">Users List</a>
 </h2>
 
 <h3 id="otherAppsUsersListHeaderWithSortParams">
-  <#assign pathInfo="/users/" />
-  <a href="${spring.url(pathInfo, context='/otherapp', sortField='birthDate', sortDirection='descending')}">Users
List</a>
+  <a href="${spring.url('/users/', context='/otherapp', sortField='birthDate', sortDirection='descending')}">Users
List</a>
 </h3>
 
 <ul>
   <#list users as user>
     <li>
       <div id="user-${user.id!}">
-        <#assign pathInfo="/users/{userId}/" />
-        <a class="userIdLink" href="${spring.url(pathInfo, userId=user.id?string)}">${user.id!}</a>
-        <#assign pathInfo="/users/${user.id}/" />
-        <a class="userNameLink" href="${spring.url(pathInfo)}">${user.firstName!} ${user.lastName!}</a>
+        <a class="userIdLink" href="${spring.url('/users/{userId}/', userId=user.id?string)}">${user.id!}</a>
+        <a class="userNameLink" href="${spring.url('/users/${user.id}/')}">${user.firstName!}
${user.lastName!}</a>
       </div>
     </li>
   </#list>
 </ul>
 
 <div id="freeMarkerManualUrl">
-  <#assign pathInfo="http://freemarker.org/docs/index.html" />
-  <a href="${spring.url(pathInfo)}">Apache FreeMarker Manual</a>
+  <a href="${spring.url('http://freemarker.org/docs/index.html')}">Apache FreeMarker
Manual</a>
 </div>
 
 </body>


Mime
View raw message