Announcement Announcement Module
No announcement yet.
More action in one form, design multy controller Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • More action in one form, design multy controller

    I guys,

    i'm trying to create a sort of multy action in one form, style struts (DispatchAction)
    I mean have more method in a controller but only one form in the jsp and use some strategy to undestand what is the method to use.

    Unfortunally reading documentation and forum I undestand that Spring doesn't provide this functionality

    actually i implemented it using javascript that automaticaly add a param in the request, so that i can mapp in the controller to undestand what is the method to execute

    this is one example of mapping of the form customer
    with 2 submit button one for delete and onothe one form modify

    @RequestMapping(value = "/customer", method = RequestMethod.POST, params="action=delete")
    @RequestMapping(value = "/customer", method = RequestMethod.POST, params="action=modify")

    it works but, for my is not clear how the design of spring mvc must be used to
    achive this requirement

    Is there some one of you that found a strategy more elegant?
    or at list that can illustrate some correct design that should be used using pure spring mvc

  • #2
    And why wouldn't it be supported. I suggest a read on how HTML forms work. The submit button you press is send as a parameter so you can determine which button is pressed. So instead of using javascript you can simply say params="name of your button here" ...