Repository: incubator-freemarker Updated Branches: refs/heads/3 b4ffc4c3f -> 0e85650a6
FREEMARKER-55: favor .ftlh rather than OutputFormat in each .ftl files Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/0e85650a Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/0e85650a Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/0e85650a Branch: refs/heads/3 Commit: 0e85650a6dd94ed3be7cb251302e210192b34d4a Parents: b4ffc4c Author: Woonsan Ko <[email protected]> Authored: Tue Nov 7 23:16:32 2017 -0500 Committer: Woonsan Ko <[email protected]> Committed: Tue Nov 7 23:16:32 2017 -0500 ---------------------------------------------------------------------- .../views/example/users/useredit.ftl | 88 -------------------- .../views/example/users/useredit.ftlh | 87 +++++++++++++++++++ .../views/example/users/userlist.ftl | 46 ---------- .../views/example/users/userlist.ftlh | 45 ++++++++++ .../test/model/bind-directive-basic-usages.ftl | 55 ------------ .../test/model/bind-directive-basic-usages.ftlh | 54 ++++++++++++ .../model/binderrors-directive-basic-usages.ftl | 70 ---------------- .../binderrors-directive-basic-usages.ftlh | 69 +++++++++++++++ .../test/model/eval-function-basic-usages.ftl | 41 --------- .../test/model/eval-function-basic-usages.ftlh | 40 +++++++++ .../model/message-function-basic-usages.ftl | 32 ------- .../model/message-function-basic-usages.ftlh | 31 +++++++ .../model/nestedpath-directive-basic-usages.ftl | 55 ------------ .../nestedpath-directive-basic-usages.ftlh | 54 ++++++++++++ .../test/model/theme-function-basic-usages.ftl | 31 ------- .../test/model/theme-function-basic-usages.ftlh | 30 +++++++ .../model/transform-function-basic-usages.ftl | 28 ------- .../model/transform-function-basic-usages.ftlh | 27 ++++++ .../test/model/url-function-basic-usages.ftl | 84 ------------------- .../test/model/url-function-basic-usages.ftlh | 83 ++++++++++++++++++ .../example/mvc/users/users-mvc-context.xml | 2 +- 21 files changed, 521 insertions(+), 531 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/useredit.ftl ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/useredit.ftl b/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/useredit.ftl deleted file mode 100644 index c206e9a..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/useredit.ftl +++ /dev/null @@ -1,88 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<head> -<title>Spring MVC Form Example - User Edit Form</title> -</head> -<body> - -<h1>Editing User: ${spring.eval("user.firstName + ' ' + user.lastName")}</h1> - -<p>${spring.message("user.form.message", user.firstName, user.lastName, user.email)}</p> - -<form method="POST" action="${spring.url('/usereditaction.do', context='/othercontext', param1='value1', param2='value2')}"> - <table border="2"> - <tbody> - <tr> - <th>${spring.message("user.id")!}</th> - <td>${user.id}</td> - </tr> - <tr> - <th>${spring.message("user.password")!}</th> - <td> - <@spring.bind "user.password"; status> - <input type="password" name="password" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>${spring.message("user.email")!}</th> - <td> - <@spring.bind "user.email"; status> - <input type="text" name="email" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>${spring.message("user.firstName")!}</th> - <td> - <@spring.bind "user.firstName"; status> - <input type="text" name="firstName" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>${spring.message("user.lastName")!}</th> - <td> - <@spring.bind "user.lastName"; status> - <input type="text" name="lastName" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>${spring.message("user.birthDate")!}</th> - <td> - <@spring.bind "user.birthDate"; status> - ${spring.transform(status.editor, status.actualValue)!} - </@spring.bind> - </td> - </tr> - <tr> - <td colspan="2"> - <input type="submit" value="${spring.message('user.form.submit')!'Save'}" /> - <input type="reset" value="${spring.message('user.form.submit')!'Reset'}" /> - </td> - </tr> - </tbody> - </table> -</form> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/useredit.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/useredit.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/useredit.ftlh new file mode 100644 index 0000000..cf2900f --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/useredit.ftlh @@ -0,0 +1,87 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<head> +<title>Spring MVC Form Example - User Edit Form</title> +</head> +<body> + +<h1>Editing User: ${spring.eval("user.firstName + ' ' + user.lastName")}</h1> + +<p>${spring.message("user.form.message", user.firstName, user.lastName, user.email)}</p> + +<form method="POST" action="${spring.url('/usereditaction.do', context='/othercontext', param1='value1', param2='value2')}"> + <table border="2"> + <tbody> + <tr> + <th>${spring.message("user.id")!}</th> + <td>${user.id}</td> + </tr> + <tr> + <th>${spring.message("user.password")!}</th> + <td> + <@spring.bind "user.password"; status> + <input type="password" name="password" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>${spring.message("user.email")!}</th> + <td> + <@spring.bind "user.email"; status> + <input type="text" name="email" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>${spring.message("user.firstName")!}</th> + <td> + <@spring.bind "user.firstName"; status> + <input type="text" name="firstName" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>${spring.message("user.lastName")!}</th> + <td> + <@spring.bind "user.lastName"; status> + <input type="text" name="lastName" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>${spring.message("user.birthDate")!}</th> + <td> + <@spring.bind "user.birthDate"; status> + ${spring.transform(status.editor, status.actualValue)!} + </@spring.bind> + </td> + </tr> + <tr> + <td colspan="2"> + <input type="submit" value="${spring.message('user.form.submit')!'Save'}" /> + <input type="reset" value="${spring.message('user.form.submit')!'Reset'}" /> + </td> + </tr> + </tbody> + </table> +</form> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/userlist.ftl ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/userlist.ftl b/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/userlist.ftl deleted file mode 100644 index aef5c91..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/userlist.ftl +++ /dev/null @@ -1,46 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<head> -<title>Spring MVC Form Example - Users</title> -</head> -<body> - -<h1>Users</h1> - -<table border="2"> - <thead> - <tr> - <th>Name</th> - <th>E-Mail</th> - </tr> - </thead> - <tbody> - <#list users as user> - <tr> - <td><a href="users/${user.id}">${user.firstName} ${user.lastName}</a></td> - <td><a href="mailto:${user.email}">${user.email}</a></td> - </tr> - </#list> - </tbody> -</table> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/userlist.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/userlist.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/userlist.ftlh new file mode 100644 index 0000000..7224eb7 --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/example/users/userlist.ftlh @@ -0,0 +1,45 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<head> +<title>Spring MVC Form Example - Users</title> +</head> +<body> + +<h1>Users</h1> + +<table border="2"> + <thead> + <tr> + <th>Name</th> + <th>E-Mail</th> + </tr> + </thead> + <tbody> + <#list users as user> + <tr> + <td><a href="users/${user.id}">${user.firstName} ${user.lastName}</a></td> + <td><a href="mailto:${user.email}">${user.email}</a></td> + </tr> + </#list> + </tbody> +</table> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/bind-directive-basic-usages.ftl ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/bind-directive-basic-usages.ftl b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/bind-directive-basic-usages.ftl deleted file mode 100644 index 2f0e535..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/bind-directive-basic-usages.ftl +++ /dev/null @@ -1,55 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<body> - -<table class="table"> - <tbody> - <tr> - <th>E-Mail</th> - <td> - <@spring.bind "user.email"; status> - <input type="text" name="email" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>First Name</th> - <td> - <@spring.bind "user.firstName"; status> - <input type="text" name="firstName" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>Last Name</th> - <td> - <@spring.bind "user.lastName"; status> - <input type="text" name="lastName" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - </tbody> -</table> - -<div id="statusValueNotReachable"><#if status??>${status.value!}</#if></div> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/bind-directive-basic-usages.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/bind-directive-basic-usages.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/bind-directive-basic-usages.ftlh new file mode 100644 index 0000000..8cd8b14 --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/bind-directive-basic-usages.ftlh @@ -0,0 +1,54 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<body> + +<table class="table"> + <tbody> + <tr> + <th>E-Mail</th> + <td> + <@spring.bind "user.email"; status> + <input type="text" name="email" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>First Name</th> + <td> + <@spring.bind "user.firstName"; status> + <input type="text" name="firstName" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>Last Name</th> + <td> + <@spring.bind "user.lastName"; status> + <input type="text" name="lastName" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + </tbody> +</table> + +<div id="statusValueNotReachable"><#if status??>${status.value!}</#if></div> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/binderrors-directive-basic-usages.ftl ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/binderrors-directive-basic-usages.ftl b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/binderrors-directive-basic-usages.ftl deleted file mode 100644 index d608615..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/binderrors-directive-basic-usages.ftl +++ /dev/null @@ -1,70 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<body> - -<@spring.hasBindErrors "user"; errors> - <div class="errors"> - <#list errors.allErrors as error> - <div class="error"> - ${spring.message(message=error)!} - </div> - </#list> - </div> -</@spring.hasBindErrors> - -<form method="POST" action="${spring.url('/users')}"> - <table class="table"> - <tbody> - <tr> - <th>E-Mail</th> - <td> - <@spring.bind "user.email"; status> - <input type="text" name="email" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>First Name</th> - <td> - <@spring.bind "user.firstName"; status> - <input type="text" name="firstName" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>Last Name</th> - <td> - <@spring.bind "user.lastName"; status> - <input type="text" name="lastName" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <td colspan="2"> - <input type="submit" name="save" value="Save" /> - </td> - </tr> - </tbody> - </table> -</form> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/binderrors-directive-basic-usages.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/binderrors-directive-basic-usages.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/binderrors-directive-basic-usages.ftlh new file mode 100644 index 0000000..e394928 --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/binderrors-directive-basic-usages.ftlh @@ -0,0 +1,69 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<body> + +<@spring.hasBindErrors "user"; errors> + <div class="errors"> + <#list errors.allErrors as error> + <div class="error"> + ${spring.message(message=error)!} + </div> + </#list> + </div> +</@spring.hasBindErrors> + +<form method="POST" action="${spring.url('/users')}"> + <table class="table"> + <tbody> + <tr> + <th>E-Mail</th> + <td> + <@spring.bind "user.email"; status> + <input type="text" name="email" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>First Name</th> + <td> + <@spring.bind "user.firstName"; status> + <input type="text" name="firstName" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>Last Name</th> + <td> + <@spring.bind "user.lastName"; status> + <input type="text" name="lastName" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <td colspan="2"> + <input type="submit" name="save" value="Save" /> + </td> + </tr> + </tbody> + </table> +</form> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/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 deleted file mode 100644 index 2498b5f..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftl +++ /dev/null @@ -1,41 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<body> - -<div id="maxNumber">${spring.eval("T(java.lang.Math).max(12.34, 56.78)")}</div> - -<ul> - <#list users as user> - <li> - <div id="user-${spring.eval('user.id')!}"> - ${spring.eval("user.firstName + ' ' + user.lastName")!} - </div> - </li> - </#list> -</ul> - -<div id="firstUserId">${spring.eval("users[0].id")!}</div> - -<#assign numbers=spring.eval("{0,1,1,2,3,5,8,13}") /> -<div id="fibonacci"><#list numbers as number>${number}<#sep>, </#list></div> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftlh new file mode 100644 index 0000000..1060b28 --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/eval-function-basic-usages.ftlh @@ -0,0 +1,40 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<body> + +<div id="maxNumber">${spring.eval("T(java.lang.Math).max(12.34, 56.78)")}</div> + +<ul> + <#list users as user> + <li> + <div id="user-${spring.eval('user.id')!}"> + ${spring.eval("user.firstName + ' ' + user.lastName")!} + </div> + </li> + </#list> +</ul> + +<div id="firstUserId">${spring.eval("users[0].id")!}</div> + +<#assign numbers=spring.eval("{0,1,1,2,3,5,8,13}") /> +<div id="fibonacci"><#list numbers as number>${number}<#sep>, </#list></div> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/message-function-basic-usages.ftl ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/message-function-basic-usages.ftl b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/message-function-basic-usages.ftl deleted file mode 100644 index fe1e65e..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/message-function-basic-usages.ftl +++ /dev/null @@ -1,32 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<body> - -<#if user??> - <div id="userId">${spring.message("user.id")!}</div> - <div id="userEmail">${spring.message("user.email")!}</div> - <div id="userInfoWithArgs">${spring.message("user.form.message", user.firstName, user.lastName, user.email)!}</div> -<#else> - <div id="errorMessage">${spring.message(message=errorMessage)!}</div> -</#if> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/message-function-basic-usages.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/message-function-basic-usages.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/message-function-basic-usages.ftlh new file mode 100644 index 0000000..7b663c1 --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/message-function-basic-usages.ftlh @@ -0,0 +1,31 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<body> + +<#if user??> + <div id="userId">${spring.message("user.id")!}</div> + <div id="userEmail">${spring.message("user.email")!}</div> + <div id="userInfoWithArgs">${spring.message("user.form.message", user.firstName, user.lastName, user.email)!}</div> +<#else> + <div id="errorMessage">${spring.message(message=errorMessage)!}</div> +</#if> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/nestedpath-directive-basic-usages.ftl ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/nestedpath-directive-basic-usages.ftl b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/nestedpath-directive-basic-usages.ftl deleted file mode 100644 index 13849bf..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/nestedpath-directive-basic-usages.ftl +++ /dev/null @@ -1,55 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<body> - -<@spring.nestedPath "user"> - <table class="table"> - <tbody> - <tr> - <th>E-Mail</th> - <td> - <@spring.bind "email"; status> - <input type="text" name="email" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>First Name</th> - <td> - <@spring.bind "firstName"; status> - <input type="text" name="firstName" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - <tr> - <th>Last Name</th> - <td> - <@spring.bind "lastName"; status> - <input type="text" name="lastName" value="${status.value!}" /> - </@spring.bind> - </td> - </tr> - </tbody> - </table> -</@spring.nestedPath> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/nestedpath-directive-basic-usages.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/nestedpath-directive-basic-usages.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/nestedpath-directive-basic-usages.ftlh new file mode 100644 index 0000000..da231bd --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/nestedpath-directive-basic-usages.ftlh @@ -0,0 +1,54 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<body> + +<@spring.nestedPath "user"> + <table class="table"> + <tbody> + <tr> + <th>E-Mail</th> + <td> + <@spring.bind "email"; status> + <input type="text" name="email" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>First Name</th> + <td> + <@spring.bind "firstName"; status> + <input type="text" name="firstName" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + <tr> + <th>Last Name</th> + <td> + <@spring.bind "lastName"; status> + <input type="text" name="lastName" value="${status.value!}" /> + </@spring.bind> + </td> + </tr> + </tbody> + </table> +</@spring.nestedPath> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/theme-function-basic-usages.ftl ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/theme-function-basic-usages.ftl b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/theme-function-basic-usages.ftl deleted file mode 100644 index efb503a..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/theme-function-basic-usages.ftl +++ /dev/null @@ -1,31 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<head> -<link rel="stylesheet" href="${spring.theme('styleSheet')}" type="text/css" /> -</head> -<body> - - <div id="user" class="${spring.theme('userClass', 'selected')}"> - ${user.firstName!} ${user.lastName!} - </div> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/theme-function-basic-usages.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/theme-function-basic-usages.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/theme-function-basic-usages.ftlh new file mode 100644 index 0000000..de8f901 --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/theme-function-basic-usages.ftlh @@ -0,0 +1,30 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<head> +<link rel="stylesheet" href="${spring.theme('styleSheet')}" type="text/css" /> +</head> +<body> + + <div id="user" class="${spring.theme('userClass', 'selected')}"> + ${user.firstName!} ${user.lastName!} + </div> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/transform-function-basic-usages.ftl ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/transform-function-basic-usages.ftl b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/transform-function-basic-usages.ftl deleted file mode 100644 index 0fb9e29..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/transform-function-basic-usages.ftl +++ /dev/null @@ -1,28 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<body> - -<@spring.bind "user.birthDate"; status> - <div id="userBirthDate">${spring.transform(status.editor, status.actualValue)}</div> -</@spring.bind> - -</body> -</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/transform-function-basic-usages.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/transform-function-basic-usages.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/transform-function-basic-usages.ftlh new file mode 100644 index 0000000..ca53330 --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/transform-function-basic-usages.ftlh @@ -0,0 +1,27 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<body> + +<@spring.bind "user.birthDate"; status> + <div id="userBirthDate">${spring.transform(status.editor, status.actualValue)}</div> +</@spring.bind> + +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/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 deleted file mode 100644 index 8cc7c65..0000000 --- a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftl +++ /dev/null @@ -1,84 +0,0 @@ -<#ftl outputFormat="HTML"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<body> - -<#-- NOTE: spring.url function should not use this number format. --> -<#setting numberFormat="00000000" /> - -<h2 id="usersListHeader"> - <a href="${spring.url('/users/')}">Users List</a> -</h2> - -<h3 id="usersListHeaderWithSortParams"> - <a href="${spring.url('/users/', sortField='birthDate', sortDirection='descending')}">Users List</a> -</h3> - -<h2 id="otherAppsUsersListHeader"> - <a href="${spring.url('/users/', context='/otherapp')}">Users List</a> -</h2> - -<h3 id="otherAppsUsersListHeaderWithSortParams"> - <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!}"> - <a class="userIdLink" href="${spring.url('/users/{userId}/', userId=user.id)}">${user.id!}</a> - <a class="userNameLink" href="${spring.url('/users/${user.id}/')}">${user.firstName!} ${user.lastName!}</a> - - <#attempt> - <a class="badUserBirthDateLink" href="${spring.url('/users/{userId}/', userId=user.id, birthDate=user.birthDate)}">${user.birthDate?date}</a> - <#recover> - <a class="goodUserBirthDateLink" href="${spring.url('/users/{userId}/', userId=user.id, birthDate=user.birthDate?string['yyyy-MM-dd'])}">${user.birthDate?date}</a> - </#attempt> - - </div> - </li> - </#list> -</ul> - -<div id="freeMarkerManualUrl"> - <a href="${spring.url('http://freemarker.org/docs/index.html')}">Apache FreeMarker Manual</a> -</div> - -<#-- List or Map is not allowed to pass as url parameter directly. --> -<#assign userIdList = [ '101', '102' ] /> -<#assign userInfoMap = { "101": "John", "102": "Jane" } /> - -<div id="listLinkTest"> - <#attempt> - <a class="badListLink" href="${spring.url('/users/', items=userIdList)}">User List Link</a> - <#recover> - <a class="goodListLink" href="${spring.url('/users/', items=userIdList?join('_'))}">User List Link</a> - </#attempt> -</div> -<div id="mapLinkTest"> - <#attempt> - <a class="badMapLink" href="${spring.url('/users/', items=userInfoMap)}">User List Link</a> - <#recover> - <a class="goodMapLink" href="${spring.url('/users/', items=userInfoMap?keys?join('_'))}">User List Link</a> - </#attempt> -</div> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftlh b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftlh new file mode 100644 index 0000000..4ae19e2 --- /dev/null +++ b/freemarker-spring/src/test/resources/META-INF/web-resources/views/test/model/url-function-basic-usages.ftlh @@ -0,0 +1,83 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<body> + +<#-- NOTE: spring.url function should not use this number format. --> +<#setting numberFormat="00000000" /> + +<h2 id="usersListHeader"> + <a href="${spring.url('/users/')}">Users List</a> +</h2> + +<h3 id="usersListHeaderWithSortParams"> + <a href="${spring.url('/users/', sortField='birthDate', sortDirection='descending')}">Users List</a> +</h3> + +<h2 id="otherAppsUsersListHeader"> + <a href="${spring.url('/users/', context='/otherapp')}">Users List</a> +</h2> + +<h3 id="otherAppsUsersListHeaderWithSortParams"> + <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!}"> + <a class="userIdLink" href="${spring.url('/users/{userId}/', userId=user.id)}">${user.id!}</a> + <a class="userNameLink" href="${spring.url('/users/${user.id}/')}">${user.firstName!} ${user.lastName!}</a> + + <#attempt> + <a class="badUserBirthDateLink" href="${spring.url('/users/{userId}/', userId=user.id, birthDate=user.birthDate)}">${user.birthDate?date}</a> + <#recover> + <a class="goodUserBirthDateLink" href="${spring.url('/users/{userId}/', userId=user.id, birthDate=user.birthDate?string['yyyy-MM-dd'])}">${user.birthDate?date}</a> + </#attempt> + + </div> + </li> + </#list> +</ul> + +<div id="freeMarkerManualUrl"> + <a href="${spring.url('http://freemarker.org/docs/index.html')}">Apache FreeMarker Manual</a> +</div> + +<#-- List or Map is not allowed to pass as url parameter directly. --> +<#assign userIdList = [ '101', '102' ] /> +<#assign userInfoMap = { "101": "John", "102": "Jane" } /> + +<div id="listLinkTest"> + <#attempt> + <a class="badListLink" href="${spring.url('/users/', items=userIdList)}">User List Link</a> + <#recover> + <a class="goodListLink" href="${spring.url('/users/', items=userIdList?join('_'))}">User List Link</a> + </#attempt> +</div> +<div id="mapLinkTest"> + <#attempt> + <a class="badMapLink" href="${spring.url('/users/', items=userInfoMap)}">User List Link</a> + <#recover> + <a class="goodMapLink" href="${spring.url('/users/', items=userInfoMap?keys?join('_'))}">User List Link</a> + </#attempt> +</div> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/0e85650a/freemarker-spring/src/test/resources/org/apache/freemarker/spring/example/mvc/users/users-mvc-context.xml ---------------------------------------------------------------------- diff --git a/freemarker-spring/src/test/resources/org/apache/freemarker/spring/example/mvc/users/users-mvc-context.xml b/freemarker-spring/src/test/resources/org/apache/freemarker/spring/example/mvc/users/users-mvc-context.xml index f5fcf24..796da8d 100644 --- a/freemarker-spring/src/test/resources/org/apache/freemarker/spring/example/mvc/users/users-mvc-context.xml +++ b/freemarker-spring/src/test/resources/org/apache/freemarker/spring/example/mvc/users/users-mvc-context.xml @@ -40,7 +40,7 @@ <bean id="viewResolver" class="org.apache.freemarker.spring.web.view.FreeMarkerViewResolver"> <property name="configuration" ref="configuration" /> <property name="prefix" value="/views/" /> - <property name="suffix" value=".ftl" /> + <property name="suffix" value=".ftlh" /> </bean> <bean id="themeSource" class="org.springframework.ui.context.support.ResourceBundleThemeSource">
