类 DefaultSessionAttributeStore

    • 方法详细资料

      • setAttributeNamePrefix

        public void setAttributeNamePrefix​(String attributeNamePrefix)
        Specify a prefix to use for the attribute names in the backend session.

        Default is to use no prefix, storing the session attributes with the same name as in the model.

      • storeAttribute

        public void storeAttribute​(WebRequest request,
                                   String attributeName,
                                   Object attributeValue)
        从接口复制的说明: SessionAttributeStore
        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.

        指定者:
        storeAttribute 在接口中 SessionAttributeStore
        参数:
        request - the current request
        attributeName - the name of the attribute
        attributeValue - the attribute value to store
      • retrieveAttribute

        public Object retrieveAttribute​(WebRequest request,
                                        String attributeName)
        从接口复制的说明: SessionAttributeStore
        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.

        指定者:
        retrieveAttribute 在接口中 SessionAttributeStore
        参数:
        request - the current request
        attributeName - the name of the attribute
        返回:
        the current attribute value, or null if none
      • getAttributeNameInSession

        protected String getAttributeNameInSession​(WebRequest request,
                                                   String attributeName)
        Calculate the attribute name in the backend session.

        The default implementation simply prepends the configured "attributeNamePrefix", if any.

        参数:
        request - the current request
        attributeName - the name of the attribute
        返回:
        the attribute name in the backend session