I use tomcat 4
I try write secure servlet fitler. When I recognize that user is not
authorized I try change web resource whith RequestDispatcher. But response
is only "404 not found"

This is example of my code:

doFilter.....{

                if(userHaveRights())
                {

                        String path =
((HttpServletRequest)request).getContextPath()+"/errorpages/errMessage.jsp";
                        try{
                                RequestDispatcher ds = 
this.ctx.getRequestDispatcher(cesta);
                                ds.forward(request,response);
                                return;
                        }
                        catch(Exception e){
                                System.err.println("SOMETHING");
                        }
                }
                else
                {
                        chain.doFilter(request, response);
                }

}

Thanks for advice.

Michal


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to