View Javadoc

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>mainMenu.jsp</code> page.</p>
28   */
29  
30  public class MainMenuBacking extends AbstractBacking {
31  
32  
33      // -------------------------------------------------------- Static Variables
34  
35  
36      private static final Log log = LogFactory.getLog(MainMenuBacking.class);
37  
38  
39      // ----------------------------------------------------------------- Actions
40  
41  
42      /***
43       * <p>Forward to the <em>Edit Registration</em> action.</p>
44       */
45      public String edit() {
46  
47          if (log.isDebugEnabled()) {
48              log.debug("edit()");
49          }
50          FacesContext context = FacesContext.getCurrentInstance();
51          StringBuffer sb = registration(context);
52          sb.append("?action=Edit");
53          forward(context, sb.toString());
54          return (null);
55  
56      }
57  
58  
59      /***
60       * <p>Forward to the <em>Logoff</em> action.</p>
61       */
62      public String logoff() {
63  
64          if (log.isDebugEnabled()) {
65              log.debug("logoff()");
66          }
67          FacesContext context = FacesContext.getCurrentInstance();
68          forward(context, logoff(context).toString());
69          return (null);
70  
71      }
72  
73  
74  }