2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.usecases.symbols;
19
20 import java.util.Map;
21
22 import org.apache.shale.view.AbstractViewController;
23
24 /***
25 * <p>This view controller manages state outside of the managed beans
26 * associated with the form. It's purpose is to respond to the loading
27 * of the page and processing the posted events.</p>
28 */
29 public class RegistrationForm extends AbstractViewController {
30
31 /***
32 * <p>This view controller is scoped in the request. The init method
33 * is invoked for each request and the page's state is stored in
34 * session scoped beans. The dialog for these session scoped
35 * beans are managed through this stateless controller.
36 * This separation of view model data and action controller is similar
37 * to Struts Action 1.x.</p>
38 */
39 public void init() {
40
41 String init = (String) ((Map) getBean("param")).get("init");
42 boolean isInit = Boolean.valueOf(init).booleanValue();
43 if (isInit) {
44 BasicPerson person = new BasicPerson();
45 person.setFirstName("Gary");
46 person.setLastName("VanMatre");
47 setBean("basicPerson", person);
48
49 setBean("fullPerson", new FullPerson());
50 setBean("businessPerson", new BusinessPerson());
51 }
52 }
53
54 /***
55 * <p>Handles action of saving the pages state.</p>
56 */
57 public String save() {
58 return "save";
59 }
60
61 }