1. What is the main job of DefaultHandlerExceptionResolver?
Why:DefaultHandlerExceptionResolver handles exceptions that Spring MVC throws internally and translates each one into a specific HTTP status code.
2. Do you need to register DefaultHandlerExceptionResolver manually in the DispatcherServlet?
Why: This resolver is registered by default in the DispatcherServlet, so no extra setup is needed.
3. Which method does DefaultHandlerExceptionResolver use to send the status code to the client?
Why: It calls sendError(statusCode), which makes the server show its default error page with the status code and message.
4. What does the client usually see when this resolver handles an exception?
Why: The resolver uses sendError, so the server's default error page is shown with the status and message. The exception stack trace is not included.
5. Why are HTTP status codes especially important for automated clients?
Why: Automated clients (not humans in a browser) cannot read an error page like a person would, so they depend on the status code to decide what to do next.
6. A client sends a POST request with Content-Type: text/plain to the handler below. What status code is returned?