You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Firmin David <da...@capco.com> on 2001/03/08 13:53:25 UTC

Help! Can't access ActionForm properties in Action perform()!

Hi all
I've done something stupid. I know I have, but I can't figure out what....
I'm trying to access the data entered by the user from the corresponding
formbean in my action's perform method (really rudimentary stuff, I know),
and I keep getting null pointers.
I've followed exactly what was done in the example app:

perform(blah blah, ActionForm form, etc.etc.){
	MyForm thisForm = (MyForm) form;
	thisForm.getSomething();
}

but my getSomething() gets nothing, and all I get is a null pointer
exception, because thisForm == null. 
I'm fairly sure I've rooted through the documentation, but can't find much
in the way of help.

Anyone got any idea what I've overlooked? I know everything is mapped right,
as the input is validated successfully in the formbean, and the correct
action is called.

Thanks in advance

Rgds
David

************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
The Capital Markets Company.

http://www.capco.com
***********************************************************************


Re: Help! Can't access ActionForm properties in Action perform( )!

Posted by Martin Cooper <ma...@tumbleweed.com>.
It sounds like maybe you don't have the form bean set up correctly in your
struts-config.xml. You should make sure that (a) your action mapping has a
"name=" entry, and (b) there is a form bean definition for that name which
specifies the appropriate form bean type.

Hope this helps.

--
Martin Cooper

----- Original Message -----
From: "Firmin David" <da...@capco.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, March 08, 2001 4:53 AM
Subject: Help! Can't access ActionForm properties in Action perform()!


> Hi all
> I've done something stupid. I know I have, but I can't figure out what....
> I'm trying to access the data entered by the user from the corresponding
> formbean in my action's perform method (really rudimentary stuff, I know),
> and I keep getting null pointers.
> I've followed exactly what was done in the example app:
>
> perform(blah blah, ActionForm form, etc.etc.){
> MyForm thisForm = (MyForm) form;
> thisForm.getSomething();
> }
>
> but my getSomething() gets nothing, and all I get is a null pointer
> exception, because thisForm == null.
> I'm fairly sure I've rooted through the documentation, but can't find much
> in the way of help.
>
> Anyone got any idea what I've overlooked? I know everything is mapped
right,
> as the input is validated successfully in the formbean, and the correct
> action is called.
>
> Thanks in advance
>
> Rgds
> David
>
> ************************************************************************
> The information in this email is confidential and is intended solely
> for the addressee(s).
> Access to this email by anyone else is unauthorised. If you are not
> an intended recipient, you must not read, use or disseminate the
> information contained in the email.
> Any views expressed in this message are those of the individual sender,
> except where the sender specifically states them to be the views of
> The Capital Markets Company.
>
> http://www.capco.com
> ***********************************************************************
>