You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alistair Young <al...@smo.uhi.ac.uk> on 2005/03/03 13:45:15 UTC

Action without ActionForm

Is there any way in struts-config.xml to specify an Action that doesn't 
require an ActionForm?
I have:

index.jsp -> link to controller Action -> decides which jsp to display 
-> start.jsp or stop.jsp

start.jsp and stop.jsp just have a form with a button that starts/stops 
a service. So I don't need an ActionForm

I tried:
<form-bean name="generic" 
type="org.apache.struts.action.DynaActionForm"/>

<action path="/Start" type="org.test.Actions.Start" name="generic">
   <forward name="started" path="/WEB-INF/jsp/controls/started.jsp" />
</action>

but after the "generic" form bean is used by a previous Action I get:
Cannot retrieve definition for form bean generic on action /Start

do I need a DynaActionForm for every Action that doesn't need an 
ActionForm?

thanks,
Alistair


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


Re: Action without ActionForm

Posted by Alistair Young <al...@smo.uhi.ac.uk>.
I tried that but I get:
Cannot retrieve definition for form bean null on action /Start

Alistair

On 3 Mar 2005, at 12:54, Niall Pemberton wrote:

> Just don't specify a form (i.e. no name="..." attribute) in your action
> mapping....
>
>  <action path="/Start" type="org.test.Actions.Start">
>     <forward name="started" path="/WEB-INF/jsp/controls/started.jsp" />
>  </action>
>
> Niall
> ----- Original Message -----
> From: "Alistair Young" <al...@smo.uhi.ac.uk>
> To: <us...@struts.apache.org>
> Sent: Thursday, March 03, 2005 12:45 PM
> Subject: Action without ActionForm
>
>
>> Is there any way in struts-config.xml to specify an Action that 
>> doesn't
>> require an ActionForm?
>> I have:
>>
>> index.jsp -> link to controller Action -> decides which jsp to display
>> -> start.jsp or stop.jsp
>>
>> start.jsp and stop.jsp just have a form with a button that 
>> starts/stops
>> a service. So I don't need an ActionForm
>>
>> I tried:
>> <form-bean name="generic"
>> type="org.apache.struts.action.DynaActionForm"/>
>>
>> <action path="/Start" type="org.test.Actions.Start" name="generic">
>>    <forward name="started" path="/WEB-INF/jsp/controls/started.jsp" />
>> </action>
>>
>> but after the "generic" form bean is used by a previous Action I get:
>> Cannot retrieve definition for form bean generic on action /Start
>>
>> do I need a DynaActionForm for every Action that doesn't need an
>> ActionForm?
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Action without ActionForm

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Just don't specify a form (i.e. no name="..." attribute) in your action
mapping....

 <action path="/Start" type="org.test.Actions.Start">
    <forward name="started" path="/WEB-INF/jsp/controls/started.jsp" />
 </action>

Niall
----- Original Message ----- 
From: "Alistair Young" <al...@smo.uhi.ac.uk>
To: <us...@struts.apache.org>
Sent: Thursday, March 03, 2005 12:45 PM
Subject: Action without ActionForm


> Is there any way in struts-config.xml to specify an Action that doesn't
> require an ActionForm?
> I have:
>
> index.jsp -> link to controller Action -> decides which jsp to display
> -> start.jsp or stop.jsp
>
> start.jsp and stop.jsp just have a form with a button that starts/stops
> a service. So I don't need an ActionForm
>
> I tried:
> <form-bean name="generic"
> type="org.apache.struts.action.DynaActionForm"/>
>
> <action path="/Start" type="org.test.Actions.Start" name="generic">
>    <forward name="started" path="/WEB-INF/jsp/controls/started.jsp" />
> </action>
>
> but after the "generic" form bean is used by a previous Action I get:
> Cannot retrieve definition for form bean generic on action /Start
>
> do I need a DynaActionForm for every Action that doesn't need an
> ActionForm?



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