Hello experts,
I have an issue which drives me crazy. Not sure it this is a bug in Tomcat or just my plain stupidity but here goes.
I have a custom error servlet set up, something like this. The setup works and if I simulate exceptions or 404 errors etc the servlet runs, the error page is displayed corectly, the response code is either 500 or 400... well, it works.
But the above setup does not suite me and I need to forward to a JSP (I do my operations in the servlet, put the appropriate data in request scope and forward to the JSP for displaying).
So, in my doPost/doGet method in the servlet I do:
getServletContext().getRequestDispatcher(...).forward(request, response);
The new setup works up to one point. That is, the servlet runs and forwards to the JSP, the JSP executes (I placed log instructions in it and they are executed) but in the browser I get the default tomcat error page, not the content of my JSP.
I also set up <%@page isErrorPage="true"%>
in my JSP but it does not matter if it is present or not, after the JSP is executed its response just vanishes and I get the default Tomcat error page in the browser.
Does anyone now why this does not work? I am going crazzzzzzzyyyyyyyy!
Thank you all!
P.S. I am using Tomcat 5.5.26.