1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.examples.mailreaderjpa;
19
20 /***
21 * <p>Backing bean for the <code>/mainMenu.jsp</code> view.</p>
22 */
23 public class MainMenu {
24
25
26
27
28
29 /***
30 * <p>The per-user {@link State} instance we are associated with. This
31 * value will be injected, based on the managed bean configuration.</p>
32 */
33 private State state = null;
34
35
36 /***
37 * <p>Return the per-user {@link State} instance we are associated with.</p>
38 */
39 public State getState() {
40 return this.state;
41 }
42
43
44 /***
45 * <p>Set the per-user {@link State} instance we are associated with.</p>
46 *
47 * @param state The new State instance
48 */
49 public void setState(State state) {
50 this.state = state;
51 }
52
53
54
55
56
57 /***
58 * <p>Handle a request to edit the current user data.</p>
59 */
60 public String edit() {
61
62 return "registration";
63
64 }
65
66
67 /***
68 * <p>Handle a request to log off of the application.</p>
69 */
70 public String logoff() {
71
72 getState().setUser(null);
73 return "welcome";
74
75 }
76
77
78 }