Hi Bansi,

Personally, I would only pass the userId and userRole (and probably other
properties), but definitely not the Managed Bean itself. It's no problem for
the Managed Bean to know the Spring Bean, but the other way around (Spring
Bean knowing the JSF Managed Bean) is a situation I in almost all cases
don't want.

By the way, I'm assuming you're Spring Beans perform some kind of business
logic

Greets,

Jan-Kees

-----Oorspronkelijk bericht-----
Van: Kito D. Mann [mailto:[EMAIL PROTECTED] 
Verzonden: donderdag 17 mei 2007 19:43
Aan: 'MyFaces Discussion'
Onderwerp: RE: How to Share Session between JSF(MyFaces) and Spring

Hello Bansi,

You can inject Spring beans into your JSF managed beans via the Spring
DelegatingVariableResolver. Given that, you should be able to call your
Spring bean methods and pass in the appropriate parameters. Why do your
Spring beans need direct access to the session?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann ([EMAIL PROTECTED])
Author, JavaServer Faces in Action
http://www.virtua.com - JSF/Java EE consulting, training, and mentoring
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info

> -----Original Message-----
> From: bansi [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 17, 2007 12:22 PM
> To: [email protected]
> Subject: How to Share Session between JSF(MyFaces) and Spring
> 
> 
> Hi Gurus
> Could you please tell me
> What are the best practices to  pass Session object from JSF to Spring.
> For
> example lets say  LoginBean in JSF has to store userId and userRole in
> Session object and then pass Session object to Spring Layer so that it
> can
> be accessible by any spring bean
> 
> - Do you recommend using Httpsession?
> 
> - Does OpenSessionInViewFilter provides a mechanism to store userId &
> userRole in session & then pass it onto spring layer
> 
> OR
> 
> - Is their any other mechanism that you would recommend for storing
> userId &
> userRoles into Session object at JSF Layer and then retrieve the same
> Session object at Spring layer so that it can be accessible by an
> spring
> bean
> 
> Any pointers/suggestions will be highly appreciated
> 
> Regards
> Bansi
> 
> --
> View this message in context: http://www.nabble.com/How-to-Share-
> Session-between-JSF%28MyFaces%29-and-Spring-tf3772789.html#a10667077
> Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to