V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
luckychen48
V2EX  ›  问与答

springboot 用户登陆怎么做啊

  •  
  •   luckychen48 · 2018-02-08 19:05:20 +08:00 · 1049 次点击
    这是一个创建于 2279 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前用 jsp 可以用${name} 取出 session 的值,但是用了 spirngboot 后就是 html 页面了,怎么取 session 的值呢?

    alvinbone88
        1
    alvinbone88  
       2018-02-08 19:34:44 +08:00
    用 Spring Session 来获取 session,示例在 https://docs.spring.io/spring-session/docs/current/reference/html5/#api-session
    不过要做登录的话,建议用 Spring Security,那个基本上只要改改配置就能用了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3188 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 00:33 · PVG 08:33 · LAX 17:33 · JFK 20:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.