Class ViewNameMethodReturnValueHandler

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ViewNameMethodReturnValueHandler
All Implemented Interfaces:
HandlerMethodReturnValueHandler

public class ViewNameMethodReturnValueHandler extends Object implements HandlerMethodReturnValueHandler
Handles return values of types void and String interpreting them as view name reference. As of 4.2, it also handles general CharSequence types, e.g. StringBuilder or Groovy's GString, as view names.

A null return value, either due to a void return type or as the actual return value is left as-is allowing the configured RequestToViewNameTranslator to select a view name by convention.

A String return value can be interpreted in more than one way depending on the presence of annotations like @ModelAttribute or @ResponseBody. Therefore, this handler should be configured after the handlers that support these annotations.

Since:
3.1
Author:
Rossen Stoyanchev, Juergen Hoeller