This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Is there a way to store non-error messages in Spring, such that when a form passes validation and submits to the next view, we are able to say "X number of rows updated" (for lack of a better example)?
It depends on whether you're forwarding or redirecting.
If you're simply forwarding, rather than directly setting a request attribute, the Spring way is to simply add the messages to the Model part of the ModelAndView that is returned by the OnSubmit method.
If you're forwarding, which I prefer for form submissions, there are a numbe rof approaches. You could add it to the session under a "well known" key and have your Controller invoke a utility method that extracts it and removes from the session, perhaps also placing it in the Model for rendering or having the Controller do it.
The benefit of using the Model instead of directly using the Servlet api shows up when you decide you want to use a View rendering technology other than JSP, one that doesn't know anything about servlets or sessions.
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg