Can we handle multiple forms in struts application

In one jsp i will handle a form based on the input ,I must retrieve data and set it in another form class is it possible if so how

addResource.jsp

--

<html:form >

<html:text name="resourceForm" property="resourceId" />

</html:form>

In action class method

-

retrive resourceid based on that retrieve employee information

and need to set in another form for display is it possible

[457 byte] By [mpramodka] at [2007-10-2 17:52:29]
# 1
ofcourse it is possible and quite simple, once the first form is posted to an action, populate the form class for the next form and forward the request to the second form jsp who uses the new populated form.
masoodmjana at 2007-7-13 19:10:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
but can i get the second form class because in struts-config.xml<action path="" name="resourceForm" />so we can get only resourceForm there right how about the second one
mpramodka at 2007-7-13 19:10:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

you can forward the request to a different action before redirecting to the second form, create another action like

<action path="/secondFormAction"

type=""

name="secondForm">

</action>

then in your resource form action

<action path="" name="resourceForm" >

<forward name="success" path="/secondFormAction.action"/>

</action>

the secondFormAction will create the form for you and u could put the data in request attribute and access it in the secondFormAction and then pupulate the data in the secondForm and then redirect the request to the second JSP.

hope you have got the point here, I wouldnt wont to paste anycode until you try it out.

masoodmjana at 2007-7-13 19:10:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
I got the logic .Thanks i implemented it
mpramodka at 2007-7-13 19:10:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...