Spring MVC noHandlerFound never called -


my application configured annotations , want 404's handled @controlleradvice or exceptionresolver. however, dispatcherservlet not throwing nohnadlerfoundexception when expected.

some other background: using spring security:

filterregistration.dynamic springsecurityfilterchain = container.addfilter("springsecurityfilterchain", new delegatingfilterproxy());     springsecurityfilterchain.addmappingforurlpatterns(null, false, "/*");     springsecurityfilterchain.setasyncsupported(true); 

and dispatcherservlet config:

dispatcherservlet ds = new dispatcherservlet(mvccontext);     ds.setthrowexceptionifnohandlerfound(true);      servletregistration.dynamic dispatcher = container.addservlet("servletdispatcher", ds);     dispatcher.setloadonstartup(1);     dispatcher.setasyncsupported(true);     dispatcher.addmapping("/"); 

the problem comes when processing bad request: /myapp/bad_request dispatcherservlet.dodispatch():920

// determine handler current request. mappedhandler = gethandler(processedrequest); if (mappedhandler == null || mappedhandler.gethandler() == null) {     nohandlerfound(processedrequest, response);     return; } 

gethandler returns handler of type defaultservlethttprequethandler, named "default" , never throws nohandlerfoundexception.

enter image description here

any idea how tweak configuration make work?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -