spring-framework / org.springframework.web.method.annotation / ModelFactory / initModel

initModel

fun initModel(request: NativeWebRequest, container: ModelAndViewContainer, handlerMethod: HandlerMethod): Unit

Populate the model in the following order:

  1. Retrieve "known" session attributes listed as @SessionAttributes.
  2. Invoke @ModelAttribute methods
  3. Find @ModelAttribute method arguments also listed as @SessionAttributes and ensure they're present in the model raising an exception if necessary.

Parameters

request - the current request

container - a container with the model to be initialized

handlerMethod - the method for which the model is initialized

Exceptions

Exception - may arise from @ModelAttribute methods