Home  >  Q&A  >  body text

java - jfinal/spring怎么在service类中获取当前用户信息, 在controller中获取再层层传递太麻烦了啊

是用ThreadLocal来实现吗? 怎么没访问一个页面Thread都不一样呢,我是根据Thread#id来判断的

高洛峰高洛峰2765 days ago322

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 17:54:51

    Solved it by myself
    After passing the filter, if it is not accessed once, just reset ThreadLocal once and it will be ok

    reply
    0
  • Cancelreply