This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have a servlet filter with a try/catch. In the exception catch I use a sendRedirect to my error.jsp. But that doesn't work --- the sendRedirect invokes the filter again --- and that fails again --- and that sends another redirect .... and on and on and on.
I know I can use response.sendError(..) but that doesn't give me my pretty error page.
Add logic to your filter that checks the URL to see if the request is bound for your error page, if so, let it through, if not, invoke your filter code.
Just to let you know : in a recent servlet specification( if i remember well 2.4) there is a way to configure your filter to be trigger on a forward or not (this is done in the web.xml file). I think the default behaviour is the the filter is not trigger on a forward !
another possibility is to configure your filter mapping in a way that it will not be triggered for error.jsp file.
i hope this will help you ! [ July 07, 2006: Message edited by: Benjamin Leonard ]