I\'ve set up web.xml as below. I also have an annotation-based controller, which takes in any URL pattern and then goes to the corresponding jsp (I\'ve set that up in the -
One option is to map all your error pages through your dispatcher servlet.
Create a new HTTP error controller:
@Controller
public class HTTPErrorController {
@RequestMapping(value="/errors/404.html")
public String handle404() {
return "errorPageTemplate";
}
@RequestMapping(value="/errors/403.html")
...
}
Map the error pages in web.xml
<error-page>
<error-code>404</error-code>
<location>/errors/404.html</location>
</error-page>