DispatcherServlet
has failed to load. I'm interested in catching all errors the servlet might have encountered while loading, but I'm most interested in errors caused by the servlet context file being incorrect (as this is the most common error).
I'm guessing I need to hook into (override) some method on DispatcherServlet
, but I don't know what I should be hooking in to that would catch al开发者_JAVA技巧l possible errors.
I'm able to tell if the application context has failed via overriding the ContextLoaderListener
, but I haven't been able to figure out a way to tell if the DispatcherServlet
has failed.
Any help would be much appreciated! Thanks!
Override init():
@Override
void init(ServletConfig config) throws ServletException {
try {
super.init();
} catch (Throwable t) {
// Do something
throw t;
}
}
精彩评论