类 SaTokenContextForSpringInJakartaServlet

java.lang.Object
cn.dev33.satoken.spring.SaTokenContextForSpringInJakartaServlet
所有已实现的接口:
cn.dev33.satoken.context.SaTokenContext, cn.dev33.satoken.context.SaTokenContextForReadOnly

public class SaTokenContextForSpringInJakartaServlet extends Object implements cn.dev33.satoken.context.SaTokenContextForReadOnly

此为低版本(<1.42.0) 的上下文处理方案,基于 Spring 内部工具类 RequestContextHolder 读写上下文,仅做留档,如无必要请勿使用

Sa-Token 上下文处理器 [ SpringBoot3 Jakarta Servlet 版 ],在 SpringBoot3 中使用 Sa-Token 时,必须注入此实现类,否则会出现上下文无效异常
从以下版本开始:
1.34.0
作者:
click33
  • 构造器概要

    构造器
  • 方法概要

    修饰符和类型
    方法
    说明
    cn.dev33.satoken.context.model.SaRequest
    获取当前请求的 Request 包装对象
    cn.dev33.satoken.context.model.SaResponse
    获取当前请求的 Response 包装对象
    cn.dev33.satoken.context.model.SaStorage
    获取当前请求的 Storage 包装对象
    boolean
    判断:在本次请求中,此上下文是否可用。

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    从接口继承的方法 cn.dev33.satoken.context.SaTokenContextForReadOnly

    clearContext, getModelBox, setContext
  • 构造器详细资料

    • SaTokenContextForSpringInJakartaServlet

      public SaTokenContextForSpringInJakartaServlet()
  • 方法详细资料

    • getRequest

      public cn.dev33.satoken.context.model.SaRequest getRequest()
      获取当前请求的 Request 包装对象
      指定者:
      getRequest 在接口中 cn.dev33.satoken.context.SaTokenContext
    • getResponse

      public cn.dev33.satoken.context.model.SaResponse getResponse()
      获取当前请求的 Response 包装对象
      指定者:
      getResponse 在接口中 cn.dev33.satoken.context.SaTokenContext
    • getStorage

      public cn.dev33.satoken.context.model.SaStorage getStorage()
      获取当前请求的 Storage 包装对象
      指定者:
      getStorage 在接口中 cn.dev33.satoken.context.SaTokenContext
    • isValid

      public boolean isValid()
      判断:在本次请求中,此上下文是否可用。
      指定者:
      isValid 在接口中 cn.dev33.satoken.context.SaTokenContext