7 Replies Latest reply on Jan 12, 2007 10:21 AM by Stan Silvert

    Check for session attributes through EL

    jk;l jkl; Expert

      If I want to see whether there's a user component in session scope, how in EL can I output the presence of a component in the session context?

      I tried the following but it gives an error saying the "user" property is not found:

      #{not empty sessionContext.user}
      #{not empty sessionContext['user']}

      I simply tried #{not empty user} but this always equals true (i.e. there is a user component existing somewhere) even though I don't know how the component is existing on the first access of the page. The JSF pages don't refer to any of the properties of "user" so it shouldn't be getting automatically instantiated...

      What's the proper way to check through EL if something's been added to session scope?