类 AbstractRequestAttributes
- java.lang.Object
- org.springframework.web.context.request.AbstractRequestAttributes
- 所有已实现的接口:
RequestAttributes
public abstract class AbstractRequestAttributes extends Object implements RequestAttributes
Abstract support class for RequestAttributes implementations, offering a request completion mechanism for request-specific destruction callbacks and for updating accessed session attributes.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller
- 另请参阅:
requestCompleted()
字段概要
字段 修饰符和类型 字段 说明 protected Map<String,Runnable>
requestDestructionCallbacks
Map from attribute name String to destruction callback Runnable从接口继承的字段 org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
构造器概要
构造器 构造器 说明 AbstractRequestAttributes()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected boolean
isRequestActive()
Determine whether the original request is still active.protected void
registerRequestDestructionCallback(String name, Runnable callback)
Register the given callback as to be executed after request completion.protected void
removeRequestDestructionCallback(String name)
Remove the request destruction callback for the specified attribute, if any.void
requestCompleted()
Signal that the request has been completed.protected abstract void
updateAccessedSessionAttributes()
Update all session attributes that have been accessed during request processing, to expose their potentially updated state to the underlying session manager.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute
字段详细资料
requestDestructionCallbacks
protected final Map<String,Runnable> requestDestructionCallbacks
Map from attribute name String to destruction callback Runnable
构造器详细资料
AbstractRequestAttributes
public AbstractRequestAttributes()
方法详细资料
requestCompleted
public void requestCompleted()
Signal that the request has been completed.Executes all request destruction callbacks and updates the session attributes that have been accessed during request processing.
isRequestActive
protected final boolean isRequestActive()
Determine whether the original request is still active.- 另请参阅:
requestCompleted()
registerRequestDestructionCallback
protected final void registerRequestDestructionCallback(String name, Runnable callback)
Register the given callback as to be executed after request completion.- 参数:
name
- the name of the attribute to register the callback forcallback
- the callback to be executed for destruction
removeRequestDestructionCallback
protected final void removeRequestDestructionCallback(String name)
Remove the request destruction callback for the specified attribute, if any.- 参数:
name
- the name of the attribute to remove the callback for
updateAccessedSessionAttributes
protected abstract void updateAccessedSessionAttributes()
Update all session attributes that have been accessed during request processing, to expose their potentially updated state to the underlying session manager.