Top Description Methods
org.springframework.web.bind.support

public Interface SessionAttributeStore

Known Direct Implementers
org.springframework.web.bind.support.DefaultSessionAttributeStore
Imports
org.springframework.lang.Nullable, org.springframework.web.context.request.WebRequest

Strategy interface for storing model attributes in a backend session.
Author
Juergen Hoeller
Since
2.5
See Also
org.springframework.web.bind.annotation.SessionAttributes

Method Summary

Modifier and TypeMethod and Description
public void
cleanupAttribute(WebRequest
the current request
request
,
String
the name of the attribute
attributeName
)

Clean up the specified attribute in the backend session.

public Object

Returns:

the current attribute value, or null if none
retrieveAttribute
(WebRequest
the current request
request
,
String
the name of the attribute
attributeName
)

Retrieve the specified attribute from the backend session.

public void
storeAttribute(WebRequest
the current request
request
,
String
the name of the attribute
attributeName
,
Object
the attribute value to store
attributeValue
)

Store the supplied attribute in the backend session.

Method Detail

cleanupAttributeback to summary
public void cleanupAttribute(WebRequest request, String attributeName)

Clean up the specified attribute in the backend session.

Indicates that the attribute name will not be used anymore.

Parameters
request:WebRequest

the current request

attributeName:String

the name of the attribute

retrieveAttributeback to summary
public Object retrieveAttribute(WebRequest request, String attributeName)

Retrieve the specified attribute from the backend session.

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.

Parameters
request:WebRequest

the current request

attributeName:String

the name of the attribute

Returns:Object

the current attribute value, or null if none

Annotations
@Nullable
storeAttributeback to summary
public void storeAttribute(WebRequest request, String attributeName, Object attributeValue)

Store the supplied attribute in the backend session.

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.

Parameters
request:WebRequest

the current request

attributeName:String

the name of the attribute

attributeValue:Object

the attribute value to store