I am looking for a way to pre-populate a Spring MVC form from values stored in a session-scoped bean. (using this namespace: http://www.springframework.org/tags/form).
For example, say I have added a queryInfo object to the uiModel.
How do I display the name instance variable from the queryInfo object?
<form:input path="queryInfo.name" />
Is this possible? If so how?
In your request mapping, add the bean to the model:
Then use modelAttribute in the form tag to bind it to the form:
Now name will display (provided there is a getter in your object appropriately named) when you do this:
Keep in mind form:input is a child tag of form:form. It is not meant to be used on its own.