struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantina Stamopoulou" <s...@intracom.gr>
Subject Re: Form bean -> null
Date Thu, 14 Feb 2002 10:53:21 GMT
Well,
Actually my error was that I was associating MyForm with the wrong action.
Thank U for pointing that out.

Konstantina

>
> On Thu, 14 Feb 2002 11:36:14 +0200 "Konstantina Stamopoulou"
<stak@intracom.gr>
> wrote:
> >Hello,
> >I need to use a  form bean  in struts and this is the first time I'm
doing
> that .So as newbie
> I feel I'm missing something basic. Can U help me? This is my case.
> >I have my struts-config :
> >
> > <form-beans>
> >   <form-bean      name="MyForm" type="provider.test.MyForm"/>
> ></form-beans>
> >
> >
> > <action    path="/editStream"
> >                type="provider.test.MyFormAction"
> >                name="MyForm"
> >                scope="request"
> >                validate="false">
> >      <forward name="success"              path="/streaming.jsp"/>
> > </action>
> >
> >
> >I have MyForm Bean with set and get methods and I have MyForm Action
which
> just initializes
> my form:
> >
> >
> >.........................
> >
> >if (form == null) {
> >
> >  System.out.println("Form is null");
> >
> >     form = new MyForm();
> >            if ("request".equals(mapping.getScope()))
> >                request.setAttribute(mapping.getAttribute(), form);
> >            else
> >                session.setAttribute(mapping.getAttribute(), form);
> > }
> > MyForm strmform = (MyForm) form;
> >
> >and finally my .jsp is the following:
> >
> ><html:form action="/details" >
> >   <tr> <font size="5" color="#0000A0"> Destination IP Address : </font>
> >        <html:text  property="ip1" size="3" /> <font color="#0000A0">
.
</font>
> >        <html:text  property="ip2" size="3" /> <font color="#0000A0">
.
</font>
> >        <html:text  property="ip3" size="3" /> <font color="#0000A0">
.
</font>
> >        <html:text  property="ip4" size="3" /> <font color="#0000A0">
.
</font>
> >   </tr>
> >   <tr> <html:text  property="port" size="3" /> <font color="#0000A0">
</tr>
> >   <tr> <html:text  property="lan" size="3" /> <font color="#0000A0">
</tr>
> >   <tr> <html:text  property="autostart" size="3" /> <font
color="#0000A0">
> </tr>
> >
> >
> > </html:form>
> >
> >
> >When I callthis page I get a :
> >
> >javax.servlet.ServletException: Cannot retrieve definition for form bean
null
> >
> >error, and I cannot fingure out what I 'm doing wrong.
> >
> >I would appriciated if U could provide me with any info regarding this
problem.
> >
> >Thank U in advance,
> >Konstantina
> >
> >
> >
> >
> >
>
>
> --
> Get your firstname@lastname email at http://Nameplanet.com/?su
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message