| Author |
Display a Form on a button click using struts tags
|
Vidya Gupta
Ranch Hand
Joined: Mar 18, 2012
Posts: 96
|
|
Hi,
I am having a small doubt , that is in my page am having 3 buttons and i want to display a different form when i click on each button. I want to do this by single jsp. Am having a little bit confusion in doing this.
<table align="left" border="0" cellspacing="0" cellpadding="1">
<tr>
<td>
<input type="button" value="button1" onclick="action"/>
<input type="button" value="button2" onclick="action"/>
<input type="button" value="button3" onclick="action"/>
<input type="button" value="button4" onclick="action"/>
</td>
</tr>
</table>
Here for each button it is going to different action methods, in that action method i am writing "return mapping.findForward("") " statement. This statement will forward the action to the same jsp again that contains buttons. Now i want to create a form on button click in the same jsp. am little bit confused that where to write the code to create a form in theis jsp..
Thanks In Advance,
Vidya
|
 |
Yogesh Lonkar
Ranch Hand
Joined: Jul 17, 2012
Posts: 92
|
|
from what ever i understood you want to display a form respected to the button clicked by user.
you can add this to your JSP
and inside your struts.xml file
inside your action class
|
Learning some thing New Every Day
|
 |
Vidya Gupta
Ranch Hand
Joined: Mar 18, 2012
Posts: 96
|
|
No.. i don't want to use multiple form:acion attributes in jsp..
My JSP looks like below,
display.jsp
-------------
|
 |
 |
|
|
subject: Display a Form on a button click using struts tags
|
|
|