There seems to be some confusion as to the meaning of "pre-action" here. 
Most of the time, when someone refers to "pre-action," they mean you hit 
an ActionBean, which then forwards to a JSP. In that case, the 
ActionBean is available to the JSP in the request scope and can be 
accessed with ${actionBean}.

What you're describing is exactly the opposite: you hit the JSP 
directly, and a form contained therein submits to an ActionBean. In this 
case, there is no ActionBean associated with the request. If you need an 
ActionBean instance, then you can instantiate it with s:useActionBean. 
Most of the time, if you're just generating a form, you don't need the 
ActionBean instance. Input defaults can be set using the "value" 
attribute of the input tags. I don't understand how this is a problem.

The s:useActionBean provides several capabilities other than just 
instantiating the bean, too. You can enable or disable binding, enable 
or disable validation, have it execute a given event handler, have it 
execute the event even if the the ActionBean has already been 
instantiated for this request (which it does not do by default), and 
even execute the Resolution returned from the event handler. It would be 
silly and superfluous to duplicate all that in s:form.

In any case, the general consensus among Stripes users now is that the 
pre-action pattern (as described in paragraph 1) should be preferred 
over direct access to JSPs. There are still times when one needs to 
instantiate ActionBeans from within a JSP, and that's when 
s:useActionBean is useful.

-Ben

Phil Sladen wrote:
> I have been recommending Stripes to a friend on mine, but unfortunately he
> immediately stumbled upon the issue that you have to have to explicitly make
> a call to UseActionBean to use your actionbean in a pre-action JSP. Please
> can someone explain why the bean shouldn't be available by default. Thanks.
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to