The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:Somebody's been working with Struts, I think.
A session-scope object has a fairly long lifetime. Unlike request-scope objects, which are created and destroyed every time you submit a request, session objects, once created, live until the session itself is destroyed, either explicitly or because the session timed out due to inactivity. So no, you won't lose your "form bean" (or more accurately speaking, your Managed Bean named "form"). Therefore you can safely inject it into any bean of equal or shorter lifespan - meaning that session beans can be injected into other session beans and/or request beans, but request beans cannot be injected into session beans (JSF will throw an error, if you try).
Occasionally this restriction requires a little creativity. For example, you might need to inject in the other direction in order to satisfy these restrictions. That is, if you a have a request-scope object that needs to be processed by a session-scope object, you'd have to inject the session-scope object into the request-scope object, then have the request-scope object perform a callback on the injected object. That's not as awkward or unnatural as it may sound, just takes getting used to the Inversion of Control way of doing things. IoC isn't unique to JSF - the Spring Framework, for example is all about IoC.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|