You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Hollaway, Shedrick CIV (TRFKB C600)" <Sh...@trfkb.navy.mil> on 2004/08/12 14:50:34 UTC

Multiple forms in one JSP + one Action

I am unable to find a solution or an alternate way of having multiple forms
in one jsp and upon submit one action handling all forms.The jsp will have
the forms as follows:

<html:form>
	<%-- first form stuff -- using formA --%>
	<html:form>
		<%-- second form stuff -- using formB --%>
	</html:form>
	<html:form>
		<%-- third form stuff -- using formB --%>
	</html:form>
</html:form>

How do I indicate to the action that it depends on two forms? Or should I be
using nested forms? Which I can't find docs or HOWTO for? I would be
thankful for any help?

Shedrick 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Multiple forms in one JSP + one Action

Posted by Thomas SMETS <ts...@tsmets.lautre.net>.
First form has among other things:
two attributes of the type formB1 & formB2 (with the accessors getFormB1 &
getFormB2).
The fields in the forms are then named :
 _ formB1.name, formB1.surname
 _ formB2.name, formB2.surname


Don't forget to instanciate in the FormABean the two "sub" beans.

\T,


> I am unable to find a solution or an alternate way of having multiple
> forms in one jsp and upon submit one action handling all forms.The jsp
> will have the forms as follows:
>
> <html:form>
> 	<%-- first form stuff -- using formA --%>
> 	<html:form>
> 		<%-- second form stuff -- using formB1 --%>
> 	</html:form>
> 	<html:form>
> 		<%-- third form stuff -- using formB2 --%>
> 	</html:form>
> </html:form>
>
> How do I indicate to the action that it depends on two forms? Or should
> I be using nested forms? Which I can't find docs or HOWTO for? I would
> be thankful for any help?
>
> Shedrick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


-- 
Thomas SMETS
rue J. Wytsmanstraat 62
1050 Brussels



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Multiple forms in one JSP + one Action

Posted by Rick Reumann <st...@reumann.net>.
Hollaway, Shedrick CIV (TRFKB C600) wrote:

> I am unable to find a solution or an alternate way of having multiple forms
> in one jsp and upon submit one action handling all forms.The jsp will have
> the forms as follows:
> 
> <html:form>
> 	<%-- first form stuff -- using formA --%>
> 	<html:form>
> 		<%-- second form stuff -- using formB --%>
> 	</html:form>
> 	<html:form>
> 		<%-- third form stuff -- using formB --%>
> 	</html:form>
> </html:form>

Ok, not trying to be a jerk here, but this shows you didn't even look at 
a single example built with Struts. There are billion examples now 
available on Struts and you need to look at least one of those examples. 
Have you even looked at the struts documentation of the html:form tag 
http://struts.apache.org/userGuide/struts-html.html#form  ?  Have you 
seen an example of where you just saw <html:form> defined with no other 
attributes?

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Multiple forms in one JSP + one Action

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 05:50 AM 8/12/2004, you wrote:
>I am unable to find a solution or an alternate way of having multiple forms
>in one jsp and upon submit one action handling all forms.The jsp will have
>the forms as follows:

You can have many forms but can submit only one at a time.  What are you 
trying to do?

Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org