Hi Stanley,

> Let's say I have a link that allows a user to empty his/her shopping
> cart.  The link to empty the cart points to "/empty.do".  I
> do not believe
> this requires an ActionForm bean (PLEASE, correct me if I am
> wrong).  Nonetheless, I have specified an ActionForm Bean
> because it is
> required:
>
>      <action path="/empty"
>              type="EmptyAction"
>              name="buyBean"
>              scope="request">
>          <forward name="success" path="/viewcart.jsp"/>
>      </action>
>
> The bean is NOT used and has nothing to do with emptying the shopping
> cart.  Do I just accept that it works?  Or am I designing the program
> wrong?  Please help.

You don't have to specifiy an ActionForm if you don't need one.
Watch the LogoffAction in the example shipped with struts:

<!-- Process a user logoff -->
<action path="/logoff"
        type="org.apache.struts.example.LogoffAction">
        <forward name="success"              path="/index.jsp"/>
</action>

Hope this helps,

Tobias Meyer

Reply via email to