Skip to content

spring views

Eric F. Alsheimer edited this page Jan 12, 2018 · 1 revision

Spring Views

ViewResolvers

ViewResolvers are how a 'view' is 'resolved', i.e. how Spring know what view to use when the controller's action is completed. By default the controller will use the InternalResourceViewResolver to determine what view is to be rendered. When the controller is returning a String, that string will be considered the name of the view that is to be retrieved and rendered (in the WEB-INF/views/.jsp location).

@RequestMapping("/")
public String doWelcome(Model model) {
  ...
  return "welcomeIndex";
}

JSPs interpolation

JSPs interpolate controller-model values using ${...}

Clone this wiki locally