I have been thinking, how is it possible for me to send an email when a particular HTTP Error code happens in my Spring MVC Web app. Please take a look at my web.xml configuration. It works fine and redirects me to the particular error page.
<web-app ...>
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/pages/404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/pages/500.jsp</location>
</error-page>
</web-app>
But what I want is, I want to send email or logged the occurence of this particular error. I was told in my earlier question that this type of error does not get handled by my controller hierarchy.
Any thoughts please?