@ SuppressWarnings ( "WeakerAccess" ) protected Optional < String > resolveView ( AnnotationMetadata route , Object responseBody ) { Optional optionalViewName = route . getValue ( View . class ) ; if ( optionalViewName . isPresent ( ) ) { return Optional . of ( ( String ) optionalViewName . get ( ) ) ; } else if ( responseBody instanceof ModelAndView ) { return ( ( ModelAndView ) responseBody ) . getView ( ) ; } return Optional . empty ( ) ; }
Resolves the view for the given method and response body . Subclasses can override to customize .