views:

304

answers:

1

Hi. I have a java web application running on Spring Web FLow,Spring Faces. I would like to ask as to how to properly manage error messages display. Should I do the usual storing of error messages on the session? Or is there a better handling by Spring regarding the matter.

A: 

The flashScope is intended for just this type of "display a once-off message to the user" usage. You can use it in combination with a resource bundle and the or tags to retrieve the localized error string from a key stored in the flashScope.

Spring Web Flow offers a level of automation for error messages if you make use of the validation framework so you may not even need to do the above manually. However not knowing your exact use case, it's hard to recommend a specific approach.

Pavel