This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
setStatus() does not trigger the container to generate an error page, it just sends the status code to teh browser, which is then displayed by the browser. So it should only be used for setting non-error status codes, eg SC_OK I think <error-page> only works with sendError()
Hi , I think that <error-page> & sendError() are 2 different things.sendError() is for sending messages like SC_UNAUTHORIZED explicitly while if some error occurs in your application then the page in error-page is shown.
CMIW <error-page> has associated exception OR error code. I think if you are using sendError(), then it should display server's default error page for it rather than associated error page in web.xml. I dont have tomcat here with me.. do try and tell us too
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
If for any reason this code is executed, then will be served for the client the forbid.jsp page. For 404, if you have inside the context of the web application any request for a resource that doesn't exist, you don't have to explicity call sendError(), the container just call the page mapped in the DD. [ November 22, 2002: Message edited by: Marcelo Sousa Ancelmo ]