Dec 28th, 2011, 01:19 AM
How to set setAttributeNamePrefix(Strin) of DefaultSessionAttributeStore dynamically?
I want to set prefix of sessionAttribute that is in controller dynamically.
I read JavaDoc of DefaultSessionAttributeStore and found the method public void setAttributeNamePrefix(String attributeNamePrefix).
I know the way to set the prefix statically but I could not find dynamic way.
When I use @SessionAttributes(value = "someAttribute") in controller, the key of the session attribute is the same as the attribute variable name. Sometimes the key could be conflict to other controller's sessionAttribute. So I want to add controller class name or something as the key prefix automatically.