01: // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
02:
03: package madvoc.girl;
04:
05: import jodd.madvoc.meta.MadvocAction;
06: import jodd.madvoc.meta.In;
07: import jodd.madvoc.meta.Out;
08: import jodd.madvoc.meta.InterceptedBy;
09: import jodd.madvoc.interceptor.EchoInterceptor;
10: import jodd.madvoc.interceptor.DefaultMadvocInterceptors;
11: import jodd.petite.meta.PetiteInject;
12:
13: import java.util.List;
14:
15: @MadvocAction
16: @InterceptedBy({EchoInterceptor.class,DefaultMadvocInterceptors.class})
17: public class GirlAction {
18:
19: @PetiteInject
20: GirlManager girlManager;
21:
22: @In
23: Girl girl;
24:
25: public String add() {
26: System.out.println("GirlAction.add");
27: System.out.println(girlManager);
28: girlManager.add(girl);
29: prepare();
30: return ".list.ok";
31: }
32:
33: @Out
34: List<Girl> girls;
35:
36: public String list() {
37: System.out.println("GirlAction.list");
38: System.out.println(girlManager);
39: prepare();
40: return "ok";
41: }
42:
43: private void prepare() {
44: girls = girlManager.getAllGirls();
45: }
46:
47: }
|