This content has been marked as final.
Show 1 reply
-
1. Re: How to redirect page request by user loggedin
ssachtleben.ssachtleben.gmail.com Sep 6, 2011 2:16 AM (in response to rluceac)Add this to your faclet and invoke a method on your action bean:
<f:metadata> <s:viewAction action="#{myAction.validate}"/> </f:metadata>
On the action side:
@Inject private User user; public String validate() { if (user == null) { return "loggedIn.xhtml"; // for PrettyFaces return mappingId e.g. pretty:loggedIn } return null; }
Clean and simple solution. I assuming that you have a producer class for the logged in user.