I want to place two buttons one for save and one for delete.i am using DispatchAction as controller,how can i find which button i am pressing and how to diffrentiate?

DispatchAction

Showing Answers 1 - 2 of 2 Answers

mannu

  • Nov 3rd, 2005
 

We can use actioncommand method that will give use caption of button and by comparing it to whatever string we want we can verified.

  Was this answer useful?  Yes

Dharmendra

  • Jan 21st, 2006
 

Hi,

   You can specify parameter attribute in action mapping section of ur struts-config file and u can pass the value for parameter in jsp declaring the hidden fields.Set the hidden field value while submitting the form.Say document.frmName.hiddenField.Value="Add" and specify the hiddenField as value for parameter attribute in action mapping.

Hope it will help u.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions