Only thing I can think of is that using @Before you can specify that the
init() method only gets called on certain events using the "on" element of
@Before.

-Ben

On Mon, Aug 17, 2009 at 11:05 PM, Matt Brock <[email protected]> wrote:

> Are there any inherent disadvantages to directly presetting a property's
> default value on an ActionBean instead of using the @Before interceptor? For
> example:
>
> public class MyActionBean extends ActionBean {
>
>    private String prop = "preset";
>
>    public Resolution view() { ... }
>
>    public String getProp() { ... }
>    public void setProp(String prop) { ... }
> }
>
> ...versus...
>
> public class MyOtherActionBean extends ActionBean {
>
>    private String prop;
>
>    @Before(stages = {LifecycleStage.BindingAndValidation})
>    public void init() {
>       setProp("preset");
>    }
>
>    public Resolution view() { ... }
>
>    public String getProp() { ... }
>    public void setProp(String prop) { ... }
> }
>
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to