-
1. Re: Check for session attributes through EL
norman.richards Jan 11, 2007 9:46 PM (in response to vk101)I don't think this is possible. You could probably write a component to do this, but I think I'd go with a facelets EL function.
-
2. Re: Check for session attributes through EL
norman.richards Jan 11, 2007 9:46 PM (in response to vk101)I don't think this is possible. You could probably write a component to do this, but I think I'd go with a facelets EL function.
-
3. Re: Check for session attributes through EL
vk101 Jan 11, 2007 10:35 PM (in response to vk101)So how would you conditionally render a component based on whether a user is logged in or not (e.g. the user component has been added to session scope)?
Also, is adding a user component to session scope and checking if it exists there the best way to check whether a user is logged in? -
4. Re: Check for session attributes through EL
ssilvert Jan 11, 2007 11:42 PM (in response to vk101)Just for kicks, have you tried this?
#{not empty sessionScope.user}
"sessionScope" comes from JSF core.
Stan -
5. Re: Check for session attributes through EL
vk101 Jan 12, 2007 3:34 AM (in response to vk101)Yes that works, thank you. Now how would you do the same thing but for checking Seam-specific contexts such as conversation and business process? Does this functionality really not exist?
-
6. Re: Check for session attributes through EL
perwik Jan 12, 2007 6:03 AM (in response to vk101)I'd rather use something like
rendered="#{userSession.authenticated}"
where userSession is some bean that knows if the user is authenticated. This is also decouples the required logic from the view. -
7. Re: Check for session attributes through EL
ssilvert Jan 12, 2007 10:21 AM (in response to vk101)"lightbulb432" wrote:
Yes that works, thank you. Now how would you do the same thing but for checking Seam-specific contexts such as conversation and business process? Does this functionality really not exist?
I haven't actually tried it, but I'll take your word for it that it doesn't work.
I agree with perwik that his solution is better. However, I also think that if possible, Seam-specific contexts should be made to work. I'd file a Jira task on it with some sample code. Then see what Gavin thinks.
Stan