I am developing a JSF application. That is intended for Authourised users only.
So whenever some one trying to access any pages through URL it should redirect to Login .
I am using XHTML as front end. And using JSF framework.
And i am storing Login Bean in Session scope.
And unfortunately I have used Servlets and static pages "response.sendRedirect()".
Thanks in advance.
I think one solution is putting all pages inside WEB-INF but one problem is I am using resonse.sendRedirect() and also I am using Templates with facelets.
Please suggest me.
My Login page in folder
"/Common/Login.xhtml"
and some pages in
"/Admin/*.xhtml"
and some pages in
`"Employee/*.ahtml"`
how to set Filter for these 2 folders Admin and Employee
I gave like this but request not enering into Filter Servlet
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>/faces/Admin/*</url-pattern>
<url-pattern>/faces/Employee/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>`
if I give like this
<url-pattern>/*</url-pattern>
its going into Infinite loop please give your solution for this prob