jsf 2 - Sending "Authentication Required Message" when not authenticated and "Session has expired" when session is timed out -


I am working with the login filter and have successfully implemented them

Also, It needs to show that if someone tries to see a page, I just need to show an error message, "authentication required". Error message like "Session has expired" after the session expired, implementation for later (as suggested by everyone), login or index to use filters. Redirecting xhmtm , Is over. But I thought of showing an error message.

Any help? Thanks in advance

See my answer here: Instead of using Flash or Session Area, in your case You should use the URL parameter to see that it should add a FacesMessage to @PostConstruct

You can insert in your bean:

  @PostConstruct public Zero init () {string ShowMessage = FacesContext.getCurrentInstance (). GetExternalContext (). GetRequestParameterMap (). Get ("showMessage"); If ("Truth". Acquires (Show Message)) {FacesContext.getCurrentInstance () AddMessage (empty, new FacesMessage (FacesMessage.SEVERITY_INFO, "authentication required", "keep your detailed message here")); }}    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -