You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2004/09/10 20:38:34 UTC

RE: [CANNOT SEE THE PROBLEM!!]Cannot retrieve definition for form bean null

I experimented a little bit:

1. I changed all struts tags to html tags in my
messageForm.jsp and I also excluded the opening
<html:form> and closing </html:form> tag.

   The action mapping shown below works fine.  I am
able to see the form that I want to display in the
browser.

       <action
        path="/MailMessage"
        parameter=".message.Form"
      
type="org.apache.struts.actions.ForwardAction"/>

2. I then added the opening <html:form> in the
beginning of the messageForm.jsp and the closing
</html:form> tag at the end of the messageForm.jsp.

    I got the error message 'cannot retrieve
definition for form bean null'

3. the <html:form> tag looks like (copied from my
code):

    <html:form action="/message/SendMessage">

4. the action mapping in the struts-config.xml looks
like (copied from my code):

    <action 
        path="/message/SendMessage"
        type="org.dhsinfo.message.SendMessage"
        name="messageForm"
        scope="request"
        validate="false"
        input=".message.Form">
       <forward
            name="success"
           
path="/confirmation/messageForwarded.jsp"/>
    </action>

5. I have not yet prepared the SendMessage.java in the
AppRoot/org/dhsinfo/message folder yet.

What could be the cause of the problem?

   
--- Jim Barrows <jb...@sssc.com> wrote:

> 
> 
> > -----Original Message-----
> > From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
> > Sent: Friday, September 10, 2004 10:54 AM
> > To: Struts Users Mailing List
> > Subject: RE: [HELP]Cannot retrieve definition for
> form bean null
> > 
> > 
> > Yes, I copied and pasted the code.  I did not type
> > those code while composing my request for help
> message
> > on the struts-user forum.
> 
> Okay then you have a problem in the way your action
> is declared.   You need to also declare the form
> being used with that action.  See the documentation
> for details.
> 
> > --- Jim Barrows <jb...@sssc.com> wrote:
> > 
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: Caroline Jen
> [mailto:jiapei_jen@yahoo.com]
> > > > Sent: Friday, September 10, 2004 9:56 AM
> > > > To: struts-user@jakarta.apache.org
> > > > Subject: [HELP]Cannot retrieve definition for
> form
> > > bean null
> > > > 
> > > > 
> > > > Hi, it is me again.
> > > > 
> > > > I still have problem with displaying my JSP. 
> This
> > > > time, the error message is:
> > > > 
> > > > '[ServletException
> > > in:/frame/content/messageForm.jsp]
> > > > Cannot retrieve definition for form bean null'
> 
> > > > 
> > > > 1. I click on this link:
> > > > 
> > > > <html:link action="/MailMessage">Send
> > > > Message</html:link>
> > > > 
> > > > 2. the action mapping in struts-config.xml is:
> > > > 
> > > >     <action
> > > >         path="/MailMessage"
> > > >         parameter=".message.Form"
> > > >       
> > > >
> type="org.apache.struts.actions.ForwardAction"/>
> > > 
> > > You need to look here for the problem.  Assuming
> you
> > > copied and pasted this.
> > > 
> > > 
> > > > 
> > > > What am I missing this time?
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > > 
> > > 
> > 
> > 
> > 
> > 		
> > _______________________________
> > Do you Yahoo!?
> > Shop for Back-to-School deals on Yahoo! Shopping.
> > http://shopping.yahoo.com/backtoschool
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> > 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
_______________________________
Do you Yahoo!?
Shop for Back-to-School deals on Yahoo! Shopping.
http://shopping.yahoo.com/backtoschool

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


Re: [CANNOT SEE THE PROBLEM!!]Cannot retrieve definition for form bean null

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Caroline Jen" <ji...@yahoo.com>
> I experimented a little bit:
>
> 1. I changed all struts tags to html tags in my
> messageForm.jsp and I also excluded the opening
> <html:form> and closing </html:form> tag.
>
>    The action mapping shown below works fine.  I am
> able to see the form that I want to display in the
> browser.
>
>        <action
>         path="/MailMessage"
>         parameter=".message.Form"
>
> type="org.apache.struts.actions.ForwardAction"/>
>
> 2. I then added the opening <html:form> in the
> beginning of the messageForm.jsp and the closing
> </html:form> tag at the end of the messageForm.jsp.
>
>     I got the error message 'cannot retrieve
> definition for form bean null'

That's because your <action> tag doesn't have a 'name' parameter.   When
Struts gets to your JSP and tries to evaluate the <html:form> tag, it looks
to the action mapping, and comes up with 'null' as the name of the form
bean.

-- 
Wendy Smoak


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


RE: [SOLVED]Cannot retrieve definition for form bean null

Posted by Caroline Jen <ji...@yahoo.com>.
Hi, I have found the mistake.

The mistake is that <html:textarea> is not a struts
tag equivalent to HTML <textarea> tag.

--- Caroline Jen <ji...@yahoo.com> wrote:

> I experimented a little bit:
> 
> 1. I changed all struts tags to html tags in my
> messageForm.jsp and I also excluded the opening
> <html:form> and closing </html:form> tag.
> 
>    The action mapping shown below works fine.  I am
> able to see the form that I want to display in the
> browser.
> 
>        <action
>         path="/MailMessage"
>         parameter=".message.Form"
>       
> type="org.apache.struts.actions.ForwardAction"/>
> 
> 2. I then added the opening <html:form> in the
> beginning of the messageForm.jsp and the closing
> </html:form> tag at the end of the messageForm.jsp.
> 
>     I got the error message 'cannot retrieve
> definition for form bean null'
> 
> 3. the <html:form> tag looks like (copied from my
> code):
> 
>     <html:form action="/message/SendMessage">
> 
> 4. the action mapping in the struts-config.xml looks
> like (copied from my code):
> 
>     <action 
>         path="/message/SendMessage"
>         type="org.dhsinfo.message.SendMessage"
>         name="messageForm"
>         scope="request"
>         validate="false"
>         input=".message.Form">
>        <forward
>             name="success"
>            
> path="/confirmation/messageForwarded.jsp"/>
>     </action>
> 
> 5. I have not yet prepared the SendMessage.java in
> the
> AppRoot/org/dhsinfo/message folder yet.
> 
> What could be the cause of the problem?
> 
>    
> --- Jim Barrows <jb...@sssc.com> wrote:
> 
> > 
> > 
> > > -----Original Message-----
> > > From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
> > > Sent: Friday, September 10, 2004 10:54 AM
> > > To: Struts Users Mailing List
> > > Subject: RE: [HELP]Cannot retrieve definition
> for
> > form bean null
> > > 
> > > 
> > > Yes, I copied and pasted the code.  I did not
> type
> > > those code while composing my request for help
> > message
> > > on the struts-user forum.
> > 
> > Okay then you have a problem in the way your
> action
> > is declared.   You need to also declare the form
> > being used with that action.  See the
> documentation
> > for details.
> > 
> > > --- Jim Barrows <jb...@sssc.com> wrote:
> > > 
> > > > 
> > > > 
> > > > > -----Original Message-----
> > > > > From: Caroline Jen
> > [mailto:jiapei_jen@yahoo.com]
> > > > > Sent: Friday, September 10, 2004 9:56 AM
> > > > > To: struts-user@jakarta.apache.org
> > > > > Subject: [HELP]Cannot retrieve definition
> for
> > form
> > > > bean null
> > > > > 
> > > > > 
> > > > > Hi, it is me again.
> > > > > 
> > > > > I still have problem with displaying my JSP.
> 
> > This
> > > > > time, the error message is:
> > > > > 
> > > > > '[ServletException
> > > > in:/frame/content/messageForm.jsp]
> > > > > Cannot retrieve definition for form bean
> null'
> > 
> > > > > 
> > > > > 1. I click on this link:
> > > > > 
> > > > > <html:link action="/MailMessage">Send
> > > > > Message</html:link>
> > > > > 
> > > > > 2. the action mapping in struts-config.xml
> is:
> > > > > 
> > > > >     <action
> > > > >         path="/MailMessage"
> > > > >         parameter=".message.Form"
> > > > >       
> > > > >
> > type="org.apache.struts.actions.ForwardAction"/>
> > > > 
> > > > You need to look here for the problem. 
> Assuming
> > you
> > > > copied and pasted this.
> > > > 
> > > > 
> > > > > 
> > > > > What am I missing this time?
> > > > 
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail:
> > > > user-help@struts.apache.org
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > > 		
> > > _______________________________
> > > Do you Yahoo!?
> > > Shop for Back-to-School deals on Yahoo!
> Shopping.
> > > http://shopping.yahoo.com/backtoschool
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > > 
> > > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> > 
> > 
> 
> 
> 
> 		
> _______________________________
> Do you Yahoo!?
> Shop for Back-to-School deals on Yahoo! Shopping.
> http://shopping.yahoo.com/backtoschool
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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