Compute year (displayed in page footer) based on Calendar, rather than hard-coded.
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/91ab2f9d Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/91ab2f9d Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/91ab2f9d Branch: refs/heads/master Commit: 91ab2f9dad9583ac11c812c58840830912442330 Parents: 4a74819 Author: Howard M. Lewis Ship <hls...@apache.org> Authored: Mon Dec 29 08:57:31 2014 -0800 Committer: Howard M. Lewis Ship <hls...@apache.org> Committed: Mon Dec 29 08:59:00 2014 -0800 ---------------------------------------------------------------------- .../tapestry5/integration/app1/components/Border.java | 12 +++++++++--- .../tapestry5/integration/app1/components/Border.tml | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/91ab2f9d/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java index ef117a1..e2d99fe 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java @@ -1,5 +1,3 @@ -// Copyright 2006-2013 The Apache Software Foundation -// // Licensed 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 @@ -20,6 +18,8 @@ import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.services.Request; +import java.util.Calendar; + /** * Here's a component with a template, including a t:body element. Really should rename this to "Layout" as that's the * T5 naming. @@ -34,6 +34,13 @@ public class Border @Inject private ComponentResources resources; + public static final int year; + + static + { + year = Calendar.getInstance().get(Calendar.YEAR); + } + public String getSecure() { return request.isSecure() ? "secure" : "insecure"; @@ -45,5 +52,4 @@ public class Border return true; } - } http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/91ab2f9d/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml index 555d51d..36c8b00 100644 --- a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml +++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/Border.tml @@ -55,7 +55,7 @@ <t:renderobject object="request"/> <p class="well"> - © 2008-2013 + © 2008-${year} <a href="http://apache.org/">Apache Software Foundation</a> </p> </div>