[jcifs] Forwarding after authorization failure using NtlmHttpFilter

Jonathan D Trumbull Jonathan.Trumbull at abbott.com
Sun Mar 13 02:53:38 GMT 2005


Hello,

I am using the NtlmHttpFilter to control access to a set of jsp's on a 
Resin instance.  Works very well, but I was wondering how to provide an 
error page to inform users why they have been denied access.  Currently, 
of course, they simply see a blank screen.

I am rather new at the jsp/servlet thing, but I was able to modify the 
existing filter to handle this problem.  In     a nutshell, I added a new 
configuration parameter call jcifs.util.redirectPage
that points to the notification page, and then instead of simply returning 
after a authorization failure I do this:

if (redirectPage != null){
  RequestDispatcher rd = 
passedFilterConfig.getServletContext().getRequestDispatcher(redirectPage);
  rd.forward(request, response);
}
return;

To do this I needed to store a reference to the FilterConfig object passed 
in init() but that is about the extent of the modifications.  This was so 
simple and should be such a common requirement that I was wondering if I 
am missing something.  Does this modification cause any problems or is 
there an even simpler solution that I was too dense to see?

Thanks!

--Jonathan
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list