类 HeaderWebSessionIdResolver
- java.lang.Object
- org.springframework.web.server.session.HeaderWebSessionIdResolver
- 所有已实现的接口:
WebSessionIdResolver
public class HeaderWebSessionIdResolver extends Object implements WebSessionIdResolver
Request and response header-basedWebSessionIdResolver
.- 从以下版本开始:
- 5.0
- 作者:
- Greg Turnquist, Rob Winch
字段概要
字段 修饰符和类型 字段 说明 static String
DEFAULT_HEADER_NAME
Default value forsetHeaderName(String)
.
构造器概要
构造器 构造器 说明 HeaderWebSessionIdResolver()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
expireSession(ServerWebExchange exchange)
Instruct the client to end the current session.String
getHeaderName()
Return the configured header name.List<String>
resolveSessionIds(ServerWebExchange exchange)
Resolve the session id's associated with the request.void
setHeaderName(String headerName)
Set the name of the session header to use for the session id.void
setSessionId(ServerWebExchange exchange, String id)
Send the given session id to the client.
字段详细资料
DEFAULT_HEADER_NAME
public static final String DEFAULT_HEADER_NAME
Default value forsetHeaderName(String)
.- 另请参阅:
- 常量字段值
构造器详细资料
HeaderWebSessionIdResolver
public HeaderWebSessionIdResolver()
方法详细资料
setHeaderName
public void setHeaderName(String headerName)
Set the name of the session header to use for the session id. The name is used to extract the session id from the request headers as well to set the session id on the response headers.By default set to
DEFAULT_HEADER_NAME
- 参数:
headerName
- the header name
getHeaderName
public String getHeaderName()
Return the configured header name.- 返回:
- the configured header name
resolveSessionIds
public List<String> resolveSessionIds(ServerWebExchange exchange)
从接口复制的说明:WebSessionIdResolver
Resolve the session id's associated with the request.- 指定者:
resolveSessionIds
在接口中WebSessionIdResolver
- 参数:
exchange
- the current exchange- 返回:
- the session id's or an empty list
setSessionId
public void setSessionId(ServerWebExchange exchange, String id)
从接口复制的说明:WebSessionIdResolver
Send the given session id to the client.- 指定者:
setSessionId
在接口中WebSessionIdResolver
- 参数:
exchange
- the current exchangeid
- the session id
expireSession
public void expireSession(ServerWebExchange exchange)
从接口复制的说明:WebSessionIdResolver
Instruct the client to end the current session.- 指定者:
expireSession
在接口中WebSessionIdResolver
- 参数:
exchange
- the current exchange