@Controller
public class CentralizedExceptionController extends DefaultHandlerExceptionResolver {
@Override
protected ModelAndView handleNoSuchRequestHandlingMethod(NoSuchRequestHandlingMethodException ex, HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
System.out.println("working?!");
return new ModelAndView();
}
私のコードではこれがありますが、404の場合は決して呼び出されません。 (私は私のweb.xmlに定義されたエラー・ページを持っていけない、と私はいけない)handleNoSuchRequestHandlingMethodは無効になります。
これは機能しません。これは、404が作成された同じクラスにこのメソッドを配置した場合にのみ機能します。 –