You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by pr...@vdsinc.com on 2003/03/14 02:22:14 UTC

Submitting form to an ActionMapping with no formbean?




Hello all, I have a quick question...  if I have an ActionMapping defined,
which uses type org.apache.struts.actions.ForwardAction, and I want
to invoke this Action via a form submit button, what is the best way
to accomplish this?

If I don't specify a formbean in the ActionMapping definition,
I get an error "Cannot retrieve definition for form bean null'" but
in this case, the Action doesn't need any form information.

For now, I worked around this by creating a class NullForm that
extends ActionForm, and creating a formbean "dummy" using
this class, and then naming it in my ActionMapping definition.
I was wondering if there was a better way to do this?

Thanks,


Phillip Rhodes
Application Designer
Voice Data Solutions
919-571-4300 x225
prhodes@vdsinc.com

Those who are willing to sacrifice essential liberties for a little order,
will
lose both and deserve neither. - Benjamin Franklin

This country, with its institutions, belongs to the people who inhabit it.

Whenever they shall grow weary of the existing government, they can
exercise
their constitutional right of amending it, or exercise their revolutionary
right to overthrow it.  - Abraham Lincoln

No citizen shall be denied the right to bear arms, if as a last resort, to
protect themselves from tyranny in Government. - Thomas Jefferson


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


Re: Submitting form to an ActionMapping with no formbean?

Posted by Kevin Williams <kw...@tarity.com>.
I had this same problem...it was because I had accidentally included
some additional information in my action mapping for that action in my
struts-config.xml file.  I've successfully done what you're talking
about if I keep it at just:

<action path="/add_contact"
 	type="com.equiscape.webapp.crm.action.CreateContact">
	<forward name="success" path="/add_quick_contact.do"/>
</action>

On Thu, 2003-03-13 at 17:22, prhodes@vdsinc.com wrote:
> 
> 
> 
> 
> Hello all, I have a quick question...  if I have an ActionMapping defined,
> which uses type org.apache.struts.actions.ForwardAction, and I want
> to invoke this Action via a form submit button, what is the best way
> to accomplish this?
> 
> If I don't specify a formbean in the ActionMapping definition,
> I get an error "Cannot retrieve definition for form bean null'" but
> in this case, the Action doesn't need any form information.
> 
> For now, I worked around this by creating a class NullForm that
> extends ActionForm, and creating a formbean "dummy" using
> this class, and then naming it in my ActionMapping definition.
> I was wondering if there was a better way to do this?
> 
> Thanks,
> 
> 
> Phillip Rhodes
> Application Designer
> Voice Data Solutions
> 919-571-4300 x225
> prhodes@vdsinc.com
> 
> Those who are willing to sacrifice essential liberties for a little order,
> will
> lose both and deserve neither. - Benjamin Franklin
> 
> This country, with its institutions, belongs to the people who inhabit it.
> 
> Whenever they shall grow weary of the existing government, they can
> exercise
> their constitutional right of amending it, or exercise their revolutionary
> right to overthrow it.  - Abraham Lincoln
> 
> No citizen shall be denied the right to bear arms, if as a last resort, to
> protect themselves from tyranny in Government. - Thomas Jefferson
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 



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