private static class StandaloneMockMvcBuilder.StaticViewResolver extends java.lang.Object implements ViewResolver
ViewResolver
that always returns same View.Constructor and Description |
---|
StaticViewResolver(View view) |
Modifier and Type | Method and Description |
---|---|
View |
resolveViewName(java.lang.String viewName,
java.util.Locale locale)
Resolve the given view by name.
|
private final View view
public StaticViewResolver(View view)
@Nullable public View resolveViewName(java.lang.String viewName, java.util.Locale locale)
ViewResolver
Note: To allow for ViewResolver chaining, a ViewResolver should
return null
if a view with the given name is not defined in it.
However, this is not required: Some ViewResolvers will always attempt
to build View objects with the given name, unable to return null
(rather throwing an exception when View creation failed).
resolveViewName
in interface ViewResolver
viewName
- name of the view to resolvelocale
- the Locale in which to resolve the view.
ViewResolvers that support internationalization should respect this.null
if not found
(optional, to allow for ViewResolver chaining)