On 6/14/07, Todd Patrick <Todd.Patrick_at_dtn.com> wrote:
>
>
> I have a feeling that I've inflicted my current misery due to my lack of
> knowledge about ValueExpressions and LifeCycle Phases.
>
> At which LifeCycle Phase are ValueExpressions in Java code (managed bean)
> rendered?
ValueExpresions can be evaluated at any phase. e.g. an expression for
the rendered attribute will be evaluated at every phase because it
determines whether or not the component processes in that phase.
If you have an expression that is expensive to evaluate, you need to
cache the result. I use mostly request scoped beans with getters like
public Foo getFoo() {
if(foo==null) {
initFoo();
}
return foo;
}
You could also use a @PostConstruct annotation, e.g.
private Foo foo;
...
@PostConstruct
public void initBean() {
... //init foo, bar, etc. here
}
... // simple getters/setters
Which is a little cleaner, but you'll always have to pay to initialize
things, even if they're not used.
>
> I am assuming that it's the Update model values phase?
>
> Thanks,
>
> --Todd
> NOTICE: This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any unauthorized
> use, disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all copies
> of the original message.