adding code :Response.sendError (HttpServletResponse.SC_NOT_FOUND);
in the DispatcherServlet.