spring-framework / org.springframework.web.servlet.view / ContentNegotiatingViewResolver / setUseNotAcceptableStatusCode

setUseNotAcceptableStatusCode

open fun setUseNotAcceptableStatusCode(useNotAcceptableStatusCode: Boolean): Unit

Indicate whether a 406 Not Acceptable status code should be returned if no suitable view can be found.

Default is false, meaning that this view resolver returns null for #resolveViewName(String, Locale) when an acceptable view cannot be found. This will allow for view resolvers chaining. When this property is set to true, #resolveViewName(String, Locale) will respond with a view that sets the response status to 406 Not Acceptable instead.