|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
FormController implementations provide the core business logic
for the Struts forms. By delegating the work to controllers we reduce the
complexity of the forms themselves and allow the busines-object to form
population logic to be captured in one spot.
FormController s are dynamically loaded by the actions and
so updating business logic can be a simple matter of adding a new jar with
the right controllers, and updating the struts-config.xml file.
Eg:
<action
path="/admin/handleeditsitecopy"
type="org.davesag.generica.servlet.action.HandleUpdateAction"
parameter="pipe=editsitecopy;
form-controller=com.myapp.controller.SiteCopyController;
action-controller=com.myapp.controller.SiteCopyController;
summary-controller=com.myapp.controller.SiteCopyController"
name="sitecopy"
scope="request"
validate="true"
input="/admin/editsitecopy.do">
<forward name="success" path="thanks.editsitecopy.page"/>
</action>
Note in the above example all three controllers are embodied in the same
class.
| Method Summary | |
Object |
populateFromForm(Object o)
Populates the supplied object from the Controller's form. |
void |
populateWith(Object o)
Populates the Controller's form with specific information from the supplied object. |
| Methods inherited from interface org.davesag.generica.controller.Controller |
setForm, setRequest, setResponse |
| Method Detail |
public void populateWith(Object o)
o - The Object to use to populate this form.public Object populateFromForm(Object o)
o - The Object to populate with data from the from.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||