Catch Spring MVC No Mapping Error -


I have configured my web configuration file under the exception resolver, but I'm not sure why it should not handle errors The error could be found for the servlet request, such as 'no matching' path: path '/ etc'

  bean square = "org.springframework.web.servlet.handler.SimpleMappingExceptionResolver" & gt; & Lt; Property Name = "Exception Mapping" & gt; & Lt; Theater Content & gt; & Lt; Prop key = "java.lang.exception" & gt; Exception & lt; / Prop & gt; & Lt; / Theater & gt; & Lt; / Property & gt; & Lt; / Bean & gt;  

My app is dependent on Ajax and there are cases where I change the target URL based on some user interaction.

My question is, is it possible to catch my error in my Spring MVC and forward it to my exception so that my user will not dirty 404

itemprop = "text">

SimpleMappingExceptionResolver (And HandlerExceptionResolver framework in general). If a handler is configured to handle the request, then it will not be able to remove it, and your resolver will not be invited.

The simplest thing for you is to configure the 404-handling page in your web.xml , for example

  & lt; Error-page & gt; & Lt; Error code & gt; 404 & lt; / Error code & gt; & Lt; Location & gt; /error.html< / Location & gt; & Lt; / Error page & gt;  

Comments