Announcement Announcement Module
No announcement yet.
form and MultiActionController Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • form and MultiActionController

    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:

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


  • #2
    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
      still haven't found any example on this topic... i guess what I'm willing to do is not considered a best practice


      • #4
        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
          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.