PDA

View Full Version : Having a MultiActionController with Form possibilities


DJViking
Aug 10th, 2007, 04:00 AM
I have 3 actions(change, edit and delete on a user) in an MultiActionController. Two of these actions triggers a new form view. I found myself in the need for a command object and a formBackingObject or even an onSubmit, but these are not available for an MultiActionController. The two forms would utilize the same command JavaBean(i.e. different data contained in it though).

Perhaps I could redirect it to a form controller instead, but then a MultiActionController would no longer serve its need. No point relaying to the MultiActionController if all it does is relay to another controller.

Is there no way of using a MultiActionController as an "MultiActionFormController"(Spring should have such an controller).?

Another solution would be to use an GET form instead of POST. Then I could send it to an action in the MultiActionController for processing (action="methodName").

jonnio
Sep 6th, 2007, 10:43 AM
Why can't you include a hidden tag:

<input type="hidden" name="method" value="myCustomHandlerMethod"/>

?

DJViking
Sep 6th, 2007, 11:47 AM
That is the solution I ended up using...