You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by dh...@lexmark.com on 2001/06/06 23:34:00 UTC

Can I have NO action?!


Hi.  I have a form where I display the current filename, and allow them to
change it.  As such, I don't need to do anything in the action, just let Struts
populate the form bean.

How do I go about this?  Do I need an action that does nothing in its perform
method?  Or can I set things up so no action is needed at all?

Cheers,

Dave




Re: Can I have NO action?!

Posted by Oleg V Alexeev <go...@penza.net>.
Hello dhay,

Thursday, June 07, 2001, 1:34:00 AM, you wrote:

dlc> Hi.  I have a form where I display the current filename, and allow them to
dlc> change it.  As such, I don't need to do anything in the action, just let Struts
dlc> populate the form bean.

dlc> How do I go about this?  Do I need an action that does nothing in its perform
dlc> method?  Or can I set things up so no action is needed at all?

What is the source of current filename? Do you retrieve it in your
form class? It is wrong solution if so.

Struts uses scheme with Action class (contains all logic to retrieve,
process and store data), ActionForm class (used to store values
between pages or actions and to validate it after submit), JSP-page as
view (to display values which was processed by Action class and stored
in session or request scope). According to this scheme you need to
implement action if you display by JSP any values fetched from
external source.

-- 
Best regards,
 Oleg                            mailto:gonza@penza.net



Re: Can I have NO action?!

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 6 Jun 2001 dhay@lexmark.com wrote:

> 
> 
> Hi.  I have a form where I display the current filename, and allow them to
> change it.  As such, I don't need to do anything in the action, just let Struts
> populate the form bean.
> 

Without an Action, how would Struts know where to go next?  You would
still need an action for this -- even if it's just a one-liner to return
an appropriate ActionForward.

> How do I go about this?  Do I need an action that does nothing in its perform
> method?  Or can I set things up so no action is needed at all?
> 
> Cheers,
> 
> Dave
> 
> 
> 
> 
Craig