List of usage examples for org.springframework.web.method.annotation ModelFactory getNameForReturnValue
public static String getNameForReturnValue(@Nullable Object returnValue, MethodParameter returnType)
From source file:org.springframework.web.method.annotation.ModelAttributeMethodProcessor.java
/** * Add non-null return values to the {@link ModelAndViewContainer}. *///w w w . ja v a2 s .c o m @Override public void handleReturnValue(@Nullable Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception { if (returnValue != null) { String name = ModelFactory.getNameForReturnValue(returnValue, returnType); mavContainer.addAttribute(name, returnValue); } }
From source file:org.springframework.web.method.annotation.support.ModelAttributeMethodProcessor.java
/** * Add non-null return values to the {@link ModelAndViewContainer}. *///from w ww .j a v a2 s .c o m public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception { if (returnValue != null) { String name = ModelFactory.getNameForReturnValue(returnValue, returnType); mavContainer.addAttribute(name, returnValue); } }