You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by cool dude <co...@yahoo.com> on 2002/02/27 13:03:17 UTC
Multiple Form Beans for the same for the same action
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>