dcsimg
Navigation after a ServletFilter
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Darth_Heizenberg
Posted On:   Friday, February 8, 2008 11:20 AM

Hi, I'm trying to figure out how to approach this problem in JSF. I have an application, guarded with a ServletFilter (using NTLM authentication with jCIFS) that's checking for an authentication token in the session. If the token is absent, the browser pops up a login box and lets the user enter credentials. At this point the filter allows the request to proceed to the requested URL (/index.jsp) that forwards to the first jsf page in the application. The trouble is that I can potentially have more than one 'first' or 'entry' page... and this is decided by the user's role. I want to be able to intercept the request after the Authentication Filter and depending on the user's role (retrieved in their credentials) I want t   More>>

Hi,
I'm trying to figure out how to approach this problem in JSF.

I have an application, guarded with a ServletFilter (using NTLM authentication with jCIFS) that's checking for an authentication token in the session. If the token is absent, the browser pops up a login box and lets the user enter credentials.

At this point the filter allows the request to proceed to the requested URL (/index.jsp) that forwards to the first jsf page in the application. The trouble is that I can potentially have more than one 'first' or 'entry' page... and this is decided by the user's role.

I want to be able to intercept the request after the Authentication Filter and depending on the user's role (retrieved in their credentials) I want to forward them to one of two jsf pages. For example, one page for admins, and a different page for non-admins.

I doubt if I want to handle this with another filter... since filters should really call the next chained filter on the stack. Additionally, I may want to add more filters in the chain at some point in time.

As I write this, I can envision one way of doing this. Stuff an attribute in the session and have the index.jsp page behave as the navigation controller... i.e. instead of having the standard , I could have something like .

Is this doable with an Action/ActionListener mechanism(or any other event mechanism) of some sort? Is there any other JSF construct that can help me do this? It needs to be called before the JSF navigation handler has already dispatched the request to the entry page specified in the web.xml.

Thanks,
Ananda

   <<Less
About | Sitemap | Contact