OK, after some tracing in the Spring source code, I think I have some final answers.
1) Manually adding request parameters to the URL that you pass back to the string "redirect: ..." is a VERY BAD IDEA. Spring caches the views referenced by these URLs, so if you specify many different parameters, you are effectively leaking memory, forcing the cache to store many values ββthat it does not need.
Please note that the PetClinic example code in the Spring distribution does just that, and apparently the Jira problem has been raised for fixing :-)
2) The model object is still held by Spring when the controller returns, and Spring will automatically add values ββto it at the URL you specify (as request parameters) - it PROVIDES that the model values ββare equal to String or primitive objects. Now, since the object of the form support is an object stored as a single attribute, Spring does nothing with it.
So - from an annotated controller, the best approach seems to be to add the ModelMap parameter to the handler method. When you are ready to return, do something like this:
Assuming the form backing object "formObject" has been passed as a parameter to the controller handler method (via the ModelAttribute annotation) and has properties "param1" and "param2" that are Strings - modelMap.clear(); modelMap.addAttribute("param1", formObject.getParam1()); modelMap.addAttribute("param2", formObject.getParam2()); return "redirect:/my/url";
And will Spring issue a redirect to / my / url? param1 = value; param2 = value
It seems that there is no built-in mechanism (in Spring) to turn the bean into a list of key / value pairs to add to the map, but if you really need it, the Apache BeanUtils Library will be fine. Of course, you do not want to do this for large objects, otherwise you may exceed the permissible length of the URL.
Finding all this turned out to be much more difficult than necessary :-)