You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ronald Haring <Ha...@furore.com> on 2002/03/06 09:51:19 UTC

RE: Multiple Form Beans for the same for the same action ... HELP !!!

are both formbeans added to the page/request?


Gr
Ronald 

> -----Original Message-----
> From: cool dude [mailto:cool_dude_22_in@yahoo.com]
> Sent: Thursday, February 28, 2002 5:41 AM
> To: struts-user@jakarta.apache.org
> Subject: Multiple Form Beans for the same for the same action ...
> HELP!!!
> 
> 
> Hi Guyz,
>      I have multiple forms submitted to the same
> action. Also both these forms are on the same page &
> only one of the forms are rendered based on some
> condition. Unfortunately, the form bean is not getting
> instantiated ... I think the code that I've written is
> right but obviously therez some problem. I've listed
> the code below. 
> 
> Herez what the JSP looks like -->
> 
> <body>
> <% 
>         String param=request.getParameter("param");
>         if((param!=null) && (param.equals("first"))) {
> %>      
> 
> <html:form action="/test" name="first"                
> type="test.FormBeanOne" scope="request">
> 
>     <html:submit value="First Hit" />
> 
> </html:form>
> 
> <%
>         } else  {
> %>
> 
> <html:form action="/test" name="second"
> type="test.FormBeanTwo" scope="request">
> 
>    <html:submit value="Second Hit" />
> </html:form>
> 
> <%
>         }
> %>      
> </body>
> 
> 
> Since I'm giving the form name & type in the form tag
> I do not mention this in my struts-config.xml. The
> action mapping of the struts-config is listed below :
> 
> <action-mappings>
> <action path="/test" type="test.TestMultiFormAction"  
> validate="true">
> </action>
> </action-mappings>
> 
> 
> Do you see anything wrong with what I've done ...
> 
> Thanx in advance ...
> Cheers,
> VD.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion!
> http://greetings.yahoo.com
> 
> --
> To unsubscribe, e-mail:   
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


Furore B.V.
Rijswijkstraat 175-8
Postbus 9204
1006 AE Amsterdam
tel. (020) 346 71 71
fax. (020) 346 71 77

----------------------------------------------------------------------------
---------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material
from any computer
----------------------------------------------------------------------------
---------------


RE: Multiple Form Beans for the same for the same action ... HELP !!!

Posted by keithBacon <ke...@yahoo.com>.
you need to specify the form bean in the name attribute of your action mapping.
(hence will need 2 mappings).
cheers - Keith
--- Ronald Haring <Ha...@furore.com> wrote:
> are both formbeans added to the page/request?
> 
> 
> Gr
> Ronald 
> 
> > -----Original Message-----
> > From: cool dude [mailto:cool_dude_22_in@yahoo.com]
> > Sent: Thursday, February 28, 2002 5:41 AM
> > To: struts-user@jakarta.apache.org
> > Subject: Multiple Form Beans for the same for the same action ...
> > HELP!!!
> > 
> > 
> > Hi Guyz,
> >      I have multiple forms submitted to the same
> > action. Also both these forms are on the same page &
> > only one of the forms are rendered based on some
> > condition. Unfortunately, the form bean is not getting
> > instantiated ... I think the code that I've written is
> > right but obviously therez some problem. I've listed
> > the code below. 
> > 
> > Herez what the JSP looks like -->
> > 
> > <body>
> > <% 
> >         String param=request.getParameter("param");
> >         if((param!=null) && (param.equals("first"))) {
> > %>      
> > 
> > <html:form action="/test" name="first"                
> > type="test.FormBeanOne" scope="request">
> > 
> >     <html:submit value="First Hit" />
> > 
> > </html:form>
> > 
> > <%
> >         } else  {
> > %>
> > 
> > <html:form action="/test" name="second"
> > type="test.FormBeanTwo" scope="request">
> > 
> >    <html:submit value="Second Hit" />
> > </html:form>
> > 
> > <%
> >         }
> > %>      
> > </body>
> > 
> > 
> > Since I'm giving the form name & type in the form tag
> > I do not mention this in my struts-config.xml. The
> > action mapping of the struts-config is listed below :
> > 
> > <action-mappings>
> > <action path="/test" type="test.TestMultiFormAction"  
> > validate="true">
> > </action>
> > </action-mappings>
> > 
> > 
> > Do you see anything wrong with what I've done ...
> > 
> > Thanx in advance ...
> > Cheers,
> > VD.
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Greetings - Send FREE e-cards for every occasion!
> > http://greetings.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> Furore B.V.
> Rijswijkstraat 175-8
> Postbus 9204
> 1006 AE Amsterdam
> tel. (020) 346 71 71
> fax. (020) 346 71 77
> 
> ----------------------------------------------------------------------------
> ---------------
> The information transmitted is intended only for the person
> or entity to which it is addressed and may contain confidential
> and/or privileged material. Any review, retransmission,
> dissemination or other use of, or taking of any action in
> reliance upon, this information by persons or entities other
> than the intended recipient is prohibited. If you received
> this in error, please contact the sender and delete the material
> from any computer
> ----------------------------------------------------------------------------
> ---------------
> 
> 


=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>