V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ukipoi
V2EX  ›  问与答

SpringBoot 项目,访问链接转跳至静态页面,然而转跳的页面却显示的不是路径的静态文件

  •  
  •   ukipoi · Aug 29, 2018 · 1926 views
    This topic created in 2799 days ago, the information mentioned may be changed or developed.
        @RequestMapping(value = "/home")
        public String index(HttpServletRequest request) throws Exception {
            if(request.getSession().getAttribute("user")!=null){
                return "index";
            }else
                return "login";
        }
    

    resources/static 目录下有 login.html 和 index.html 两个文件。 清除了游览器的缓存。 访问 /home,转跳到登陆界面。正常登陆之后。 重新访问 /home,debug 发现进入的是 return "index" 的方法。 运行之后游览器刷新到了 login 页面,而不是 index 页面。 控制台没有报错。 看不懂 return "index"之后的操作,请问这是哪里出了问题?

    1 replies    2018-08-29 19:59:12 +08:00
    swuzjb
        1
    swuzjb  
       Aug 29, 2018
    这么点东西 没办法判断
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4439 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:11 · PVG 08:11 · LAX 17:11 · JFK 20:11
    ♥ Do have faith in what you're doing.