Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to define functionality for 2 buttons in an action form

 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys i want to ask lets i have 2 buttons

1) Add
2) Delete on my jsp page

then how do i define my fnctionality for both of them in my page

please tell me

thank you
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<action name="uploadColorLogosEdit" class="com.javaranch.cms.ColorLogos" method="load">
<action name="uploadColorLogosEdit" class="com.javaranch.cms.ColorLogos" method="upDate">

Here we are calling the different method's depending on user request. Provide these methods in action class it will execute that method directly.
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply but how can we define in this way

in struts we define it as <form action=".do" method=post>

so how can we do it here
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The above process is applicable for struts2 and we achieve this using dynamic method invocation also. I'm not sure about struts1.x.
 
Sriram Ture
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In struts 1.x, the DispatchAction class should be used to achieve the action based method invocation.

In action tag of config xml you can define an attribute 'method' and this will decide the method to be invoked. The value for this attribute is passed on from the button click.


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic