KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > madvoc > MadvocActionsAction


1 // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
2

3 package jodd.madvoc;
4
5 import jodd.madvoc.meta.MadvocAction;
6 import jodd.madvoc.meta.In;
7 import jodd.madvoc.meta.Out;
8 import jodd.madvoc.interceptor.ScopeType;
9
10 import java.util.*;
11
12 /**
13  * Creates sorted list of all registered action configurations.
14  */

15 @MadvocAction
16 public class MadvocActionsAction {
17
18     @In(scope=ScopeType.CONTEXT)
19     WebApplication webapp;
20
21     @Out
22     List<ActionConfig> actions;
23
24     public String JavaDoc view() {
25         actions = new ArrayList<ActionConfig>();
26         for (ActionConfig actionConfig : webapp.getAllActionConfigs().values()) {
27             actions.add(actionConfig);
28         }
29         Collections.sort(actions, new Comparator<ActionConfig>() {
30             public int compare(ActionConfig a1, ActionConfig a2) {
31                 return a1.actionPath.compareTo(a2.actionPath);
32             }
33         });
34         return "ok";
35     }
36 }
37
Popular Tags