spring-framework / org.springframework.web.servlet.mvc.annotation

Package org.springframework.web.servlet.mvc.annotation

Types

ModelAndViewResolver

interface ModelAndViewResolver

SPI for resolving custom return values from a specific handler method. Typically implemented to detect special return types, resolving well-known result values for them.

A typical implementation could look like as follows:

 public class MyModelAndViewResolver implements ModelAndViewResolver { public ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType, Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest) { if (returnValue instanceof MySpecialRetVal.class)) { return new MySpecialRetVal(returnValue); } return UNRESOLVED; } }

ResponseStatusExceptionResolver

open class ResponseStatusExceptionResolver : AbstractHandlerExceptionResolver, MessageSourceAware

A org.springframework.web.servlet.HandlerExceptionResolver that uses the ResponseStatus annotation to map exceptions to HTTP status codes.

This exception resolver is enabled by default in the org.springframework.web.servlet.DispatcherServlet and the MVC Java config and the MVC namespace.

As of 4.2 this resolver also looks recursively for @ResponseStatus present on cause exceptions, and as of 4.2.2 this resolver supports attribute overrides for @ResponseStatus in custom composed annotations.

As of 5.0 this resolver also supports ResponseStatusException.