If you are using spring-mvc tags consider using form in input as follows
<form:input type="text" path="msgTo" maxlength="15" size="20"
value="${userLogin.userId}" />
http://docs.spring.io/spring/docs/2.0.8/reference/spring-form.tld.html#spring-form.tld.input
If you want to user @ModelAttribute combining with spring tags, consider read this
Basically you need to use spring.tld in your form and create a bean that has bean properties equals to the name of the elements in the form.