接口 SessionAttributeStore
- 所有已知实现类:
DefaultSessionAttributeStore
public interface SessionAttributeStore
Strategy interface for storing model attributes in a backend session.
- 从以下版本开始:
- 4.0 2022/4/8 23:19
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
方法概要
修饰符和类型方法说明voidcleanupAttribute(RequestContext request, String attributeName) Clean up the specified attribute in the backend session.retrieveAttribute(RequestContext request, String attributeName) Retrieve the specified attribute from the backend session.voidstoreAttribute(RequestContext request, String attributeName, Object attributeValue) Store the supplied attribute in the backend session.
-
方法详细资料
-
storeAttribute
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.
- 参数:
request- the current requestattributeName- the name of the attributeattributeValue- the attribute value to store
-
retrieveAttribute
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.- 参数:
request- the current requestattributeName- the name of the attribute- 返回:
- the current attribute value, or
nullif none
-
cleanupAttribute
Clean up the specified attribute in the backend session.Indicates that the attribute name will not be used anymore.
- 参数:
request- the current requestattributeName- the name of the attribute
-