...
xaction input | Java type | expected Action bean method (Java) |
---|---|---|
<myInput type="string"> | java.lang.String | setMyInput(String s) { ... |
<myInput type="long"> | java.lang.Long | setMyInput(Long n) { ... |
<myInputMap type="property-map"> | java.util.Map<java.lang.String, java.lang.String> | setMyInputMap(Map<String, String> m) { ... |
<myInputListMap type="property-map-list"> | java.util.List<java.util.Map<java.lang.String, java.lang.String>> | setMyInputListMap(List<Map<String, String>> l) { ... |
<myInputList type="string-list"> | java.util.List<java.lang.String> | setMyInputList(List<String> l) { ... |
<myInput> (no type specified) | In this case, the Action framework does not know the type and will try to convert the data to the type specified in your Action's setter method. If the conversion fails, you will see a warning to this effect. | setMyInput(Object o), |
|
|
|
h3 VarArgs Inputs
Sometimes your Action bean will need to pass inputs through to another subsystem and not act on them directly. For these inputs, it is cumbersome and sometimes impossible to create setter methods for each possible input. If this is the case for you, then have your Action bean implement the IVarArgsAction interface. This will allow you to receive a map containing all the inputs that were specified in the action definition but had no setter method counterpart in your Action bean.
Outputs
At the end of a step in an action sequence, the Action framework will attempt to retrieve data from your Action bean (per the action-outputs section of the action definition) by calling various getter methods. The framework will loop through the listed outputs and set them to the appropriate context. A discussion about the "appropriate" context is out of scope here, but suffice it to say the output data will be stored in a session-like structure and will be made accessible if you should chose to bind it to the input of a subsequent step, or bound in a way that will direct the data to the user for viewing or to a data sync such as a file. You will notice that the type attribute is not required for action outputs, other than the special case "content" type which behaves very differently from other outputs.
...