tags:

views:

304

answers:

0

I have problem with forwarding from one form (form1 1.jsp) to another (form2 2.jsp) using parameters. At first I'm using struts 1.x with org.springframework.web.struts.ContextLoaderPlugIn and tiles plugin.

My form1 looks like:

1. button1 id=1 --- collection1
2. button2 id=2 --- collection2
3. button3 id=3 --- collection3

When I click on button1 I want to forward to form2 with parameter id1.

form1 is represented by this:

<html:form action="viewDotaznikByUserId.do" method="post">

form2 is represented by this:

<html:form action="editDotaznik.do" method="post">

Definition of actions here:

<action name="userHomeForm" path="/viewDotaznikByUserId" scope="request" type="org.springframework.web.struts.DelegatingActionProxy" validate="false">
    <forward name="ok" path="userHome.view"/>
</action>

<action name="dotaznikForm" path="/editDotaznik" scope="request" type="org.springframework.web.struts.DelegatingActionProxy" validate="false">
    <forward name="ok" path="dotaznik.view"/>
</actio>

Now I'm using javascript on buttons setAction('userHomeForm','editDotaznik.do') which submits the form and call action editDotaznik.do.

How can I put there parameter id?

I tried this setAction('userHomeForm','editDotaznik.do?userId=X'), but it's no good.