0

I want to know, if it is possible to access the session as

FacesContext.getCurrentInstance().getExternalContext().getSession(false);

from EL, the thing is I want to know if the user has login or not and make possible if?

Tiny
  • 27,221
  • 105
  • 339
  • 599
Mariah
  • 1,073
  • 1
  • 14
  • 33
  • 1
    Possible duplicate http://stackoverflow.com/questions/19445455/can-we-access-session-scope-variables-directly-in-jsf-xhtml-files – Jessai Dec 05 '14 at 16:15

1 Answers1

2

There is an implicit session object available in EL as #{session} But it looks like returned session will under the hood be retrieved as follows:

return extCtx.getSession(true);

So, if you really need to get it from EL with false flag, you can put your code to method of some managed bean and call it.

Or you can call getSession from implicit request object:

#{request.getSession(false)}

BlindNW
  • 315
  • 2
  • 10