jsf 2 - Get User information in pages which are not part of any flow in Spring webflow -


in application using spring security, spring web flow , jsf. have defined flows , can extract user information using #{currentuser.name} in pages part of flow. there pages home page not part of flow , outside flow. want display user name in home page if user authenticated not able extract it. main reason might webflow, have configured in webflow.xml

<flow-executor id="flowexecutor">  <flow-execution-listeners>    <listener ref="facescontextlistener"/>    <listener ref="securitylistener"/>  </flow-execution-listeners> </flow-executor> 

since configured flows only, that's why currentuser object available pages inside flow. question "is possible currentuser object in non flow pages".

i not know currentuser object. can try spring security jsp taglib:

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>  <sec:authentication property="principal.username" /> 

for these non flow pages. hope helps.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -