1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to you under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * $Id: WelcomeBean.java 464373 2006-10-16 04:21:54Z rahul $
18 */
19
20 package org.apache.shale.blank;
21
22 import java.util.Date;
23 import org.apache.shale.view.AbstractViewController;
24
25 /***
26 * <p>Sample <code>ViewController</code> class for <code>/welcome.jsp</code>.</p>
27 */
28 public class WelcomeBean extends AbstractViewController {
29
30
31 // -------------------------------------------------------------- Properties
32
33
34 /***
35 * <p>The current date and time value.</p>
36 */
37 private Date timestamp = null;
38
39
40 /***
41 * <p>Return the current date and time value.</p>
42 */
43 public Date getTimestamp() {
44
45 return this.timestamp;
46
47 }
48
49
50 /***
51 * <p>Set the current date and time value.</p>
52 *
53 * @param timestamp The new date and time value
54 */
55 public void setTimestamp(Date timestamp) {
56
57 this.timestamp = timestamp;
58
59 }
60
61
62 // --------------------------------------------------- ViewControler Methods
63
64
65 /***
66 * <p>Just before rendering occurs, set the <code>timestamp</code>
67 * property to the current date and time.</p>
68 */
69 public void prerender() {
70
71 setTimestamp(new Date());
72
73 }
74
75
76 }