Results 1 to 5 of 5

Thread: form and MultiActionController

  1. #1
    Join Date
    Feb 2006
    Location
    Rome, Italy
    Posts
    77

    Question form and MultiActionController

    hello,
    i'd like to use a multiActionController but be able to 'mark' some of the actions it defines as those responding to a form submission: so that I can be possible to define a command bean, a validator, etc etc.

    i found this open issue: http://opensource.atlassian.com/proj...browse/SPR-583

    which points to some broken-link pages on this forum..


    thanks,
    valerio

  2. #2
    Join Date
    Feb 2006
    Location
    Rome, Italy
    Posts
    77

    Default some hints in the javadoc

    i think I should have read the javadoc more carefully. i found this little-tiny note on the javadoc of MultiActionController:

    Note: For maximum data binding flexibility, consider direct usage of a ServletRequestDataBinder in your controller method, instead of relying on a declared command argument. This allows for full control over the entire binder setup and usage, including the invocation of Validators and the subsequent evaluation of binding/validation errors.
    so, it seems this is what i wanted to do. I still don't get how can I define validators, command beans and all the necessary stuff directly from the spring xml application descriptor, if possible.
    Any example could be very helpful.

  3. #3
    Join Date
    Feb 2006
    Location
    Rome, Italy
    Posts
    77

    Unhappy

    still haven't found any example on this topic... i guess what I'm willing to do is not considered a best practice

  4. #4
    Join Date
    May 2005
    Location
    California, US
    Posts
    735

    Default

    Sorry to be contrary, but what's the appeal of the MultiActionController? Personally, I prefer the more verbose method of having a separate class/controller for each operation.

  5. #5
    Join Date
    Nov 2005
    Location
    inside milk carton
    Posts
    51

    Default

    I'm not quite sure I understand what the question is but I'll try.

    Do you want to determine what the action is based on user events? if so then this is possible by using client side onchange, onblur, etc...

    Or is you question, can your MAC determine if its a form POST vs a GET. Sure by using request.getMethod().

    Hope this helps.

    but what's the appeal of the MultiActionController?
    The MAC is great because it provides a extremely simplified version of the Service Locator Pattern, and you able to group similar functionality methods into one controller thus making designs more OO.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •