Responses to both Jeff and Tomek below. On 12/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Actually I don't know how to do it, could please you send me some example, or some links?
<managed-bean> <managed-bean-name>yourBean</managed-bean-name> <managed-bean-class>yourpackage.yourbean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> [...] <managed-property> <property-name>loginBean</property-name> <value>#{loginBean}</value> </managed-property> [...] </managed-bean> On 12/7/06, Jeff Bischoff <[EMAIL PROTECTED]> wrote:
Mike Kienenberger wrote: > Better yet would be to set loginBean as a managed property for any > beans that use it. Then you don't need to write any code. This won't work in all cases (e.g. A session bean looking up a request bean). Also, some of us prefer not to managed dependencies between java classes in XML. :) So I would say it's another option, but not always better. Feel free to educate me on why you disagree.
No, that's a fair comment, and I thought of the same limitation after I posted the message. It's another option in many cases. I won't argue about the subjective "better" part (although unit testing dependency injection comes to mind).