public class DefaultSessionAttributeStore extends java.lang.Object implements SessionAttributeStore
SessionAttributeStore
setAttributeNamePrefix(java.lang.String)
RequestAttributes.setAttribute(java.lang.String, java.lang.Object, int)
RequestAttributes.getAttribute(java.lang.String, int)
RequestAttributes.removeAttribute(java.lang.String, int)
DefaultSessionAttributeStore()
void
cleanupAttribute(WebRequest request, java.lang.String attributeName)
protected java.lang.String
getAttributeNameInSession(WebRequest request, java.lang.String attributeName)
java.lang.Object
retrieveAttribute(WebRequest request, java.lang.String attributeName)
setAttributeNamePrefix(java.lang.String attributeNamePrefix)
storeAttribute(WebRequest request, java.lang.String attributeName, java.lang.Object attributeValue)
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public DefaultSessionAttributeStore()
public void setAttributeNamePrefix(@Nullable java.lang.String attributeNamePrefix)
Default is to use no prefix, storing the session attributes with the same name as in the model.
public void storeAttribute(WebRequest request, java.lang.String attributeName, java.lang.Object attributeValue)
Can be called for new attributes as well as for existing attributes. In the latter case, this signals that the attribute value may have been modified.
storeAttribute
request
attributeName
attributeValue
@Nullable public java.lang.Object retrieveAttribute(WebRequest request, java.lang.String attributeName)
This will typically be called with the expectation that the attribute is already present, with an exception to be thrown if this method returns null.
null
retrieveAttribute
public void cleanupAttribute(WebRequest request, java.lang.String attributeName)
Indicates that the attribute name will not be used anymore.
cleanupAttribute
protected java.lang.String getAttributeNameInSession(WebRequest request, java.lang.String attributeName)
The default implementation simply prepends the configured "attributeNamePrefix", if any.
"attributeNamePrefix"
Impressum und Datenschutz Copyright ©2018 eir.me