I'm currently using the @ModelAttribute annotation in my controllers to add reference data to my pages and forms, ie:
@ModelAttribute("someValue")
public String getSomeValue() {
return someValue;
}
This works great until I start using redirects from the controllers. All of the values from methods marked with @ModelAttribute appear in the URL, ie:
http://somedomain.com/page?someValue=value
Is there a setting to turn this off? Or is there a simple fix for this?
I read something about creating an interceptor for adding reference data into a model, but that just seems wrong:
http://developingdeveloper.wordpress.com/2008/02/28/common-reference-data-in-spring-mvc/