Originally posted by Kev D'Arcy:
Hi all,
I'm using client certificates as my log in mechanism in my webapp and I'm wondering if there's a way to have the login process redirected to a handler class before it hits a jsp/jsf page. What I need to happen is that once the user has been authenticated and authorised, the roles that the user is assigned to will dictate the contents of a radio button list on the first page that the user sees. The only way I know of doing this is by forwarding the request to a servlet, carrying out the necessary processing and then redirecting the user to the required page.
Is there a neater way of doing this?
Kev
My own idea(I may be wrong ) is add an ActionEvent to the command button, Once the button is clicked , The following is executed
FacesContext context=FacesContext.getCurrentInstance();
Application application=context.getApplication();
NavigationHandler navigation=application.getNavigationHandler();
//do all role checking here and set settings for radio button
// visibilty for next page
if (authorized){
navigation.handleNavigation(context,null,"\faces\nextPage.jsp");
}
if (NotAuthorized){
navigation.handleNavigation(context,null,"\faces\errorPage.jsp");
}