I am using Spring MVC and have successfully setup a WebApplicationInitializer (using Tomcat's ServletContainerInitializer), without any web.xml file. Adding filters (like Spring Security) and servlets (like Dispatcher) is no problem, and they work fine. I can also set init-params if I need to do so.
What I can't figure out is how to set up some of the special tags that normally exist in the web.xml. For example, I would like to set up a custom 403 error page. Usually I would do this in web.xml with:
<error-page>
<error-code>403</error-code>
<location>/accessDenied.html</location>
</error-page>
But I can't figure out how to do this inside the WebApplicationInitializer (which has access to the ServletContext).
I have the same problem with session-timeout and welcome-files. I've been searching for about two days, but still haven't seen this done programmatically. Again the goal is to completely remove the web.xml file and use the initializer class instead.
Any ideas?