Announcement Announcement Module
Collapse
No announcement yet.
How to invoke methods for multiple actions in jsp by using multiaction controller? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to invoke methods for multiple actions in jsp by using multiaction controller?

    Hello all,
    Im new to spring MVC and im trying to work on multi action controller.My question is when im trying to invoke methods in my controller by passing method names as parameters then its working fine.
    example:<a href="user.do?action=getMessage" ></a><br>
    <a href="user.do?action=getUser" ></a>

    but in another scenario iam using two buttons and i want to invoke separte methods for each.i thought multi action controller takes input filed name as its method name defaultly(i.e getUser() and getMessage() ) but its not working in this case.
    example:
    <input type="button" value="Show" name="getUser" >
    <input type="button" value="Show" name="getMessage">

    so can any one help me in this regard

  • #2
    Hi smaddali

    Originally posted by smaddali
    but in another scenario iam using two buttons and i want to invoke separte methods for each.i thought multi action controller takes input filed name as its method name defaultly(i.e getUser() and getMessage() ) but its not working in this case.
    example:
    <input type="button" value="Show" name="getUser" >
    <input type="button" value="Show" name="getMessage">
    Why not use a link instead of a button? Or use the "onClick"-event of the button and javascript to call an url?

    Although I see your point and cannot answer if what you try to du should be possible as well.


    Rgds
    guybrush

    Comment


    • #3
      Thanks 4 ur reply

      Actually i also tried it yesterday and it worked.

      Comment

      Working...
      X