KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > webapp > example > IndexBacking


1 /*
2  * Copyright 1999-2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17
18 package org.apache.struts.webapp.example;
19
20
21 import javax.faces.context.FacesContext;
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24
25
26 /**
27  * <p>Backing bean for the <code>index.jsp</code> page.</p>
28  */

29
30 public class IndexBacking extends AbstractBacking {
31
32
33     // -------------------------------------------------------- Static Variables
34

35
36     private static final Log log = LogFactory.getLog(IndexBacking.class);
37
38
39     // ----------------------------------------------------------------- Actions
40

41
42     /**
43      * <p>Forward to the <em>Create Registration</em> action.</p>
44      */

45     public String JavaDoc create() {
46
47         if (log.isDebugEnabled()) {
48             log.debug("create()");
49         }
50         FacesContext context = FacesContext.getCurrentInstance();
51         StringBuffer JavaDoc sb = registration(context);
52         sb.append("?action=Create");
53         forward(context, sb.toString());
54         return (null);
55
56     }
57
58
59     /**
60      * <p>Forward to the <em>Logon</em> page.</p>
61      */

62     public String JavaDoc logon() {
63
64         if (log.isDebugEnabled()) {
65             log.debug("logon()");
66         }
67         return "logon";
68
69     }
70
71
72 }
73
Popular Tags