zoukankan      html  css  js  c++  java
  • Spring Boot异常

    1、使用thymeleaf模板异常

    项目在myeclipse启动后访问正常,但是打包成jar后,启动后访问页面异常,异常信息如下

    异常信息:template might not exist or might not be accessible by any of the configured Template Resolvers

    解决方法:把路径前面的斜杠去掉

    例如

    @RequestMapping(value="/admin",method = RequestMethod.GET)
    public String mainPage(HttpServletRequest request,HttpServletResponse response,Model model){
    try{
        if(request.getSession().getAttribute("messageName")==null)
            response.sendRedirect("http://"+WeiXinBUS.weixin_web_url+"/adminLogin.html");
    }
    catch(Exception e){e.printStackTrace();}
        model.addAttribute("username",request.getSession().getAttribute("messageName"));//将用户名保存到参数中
        //return "/administer/administer";  //myeclipse上启动访问正常,打包成jar后启动访问报错

        return "administer/administer";   //去掉斜杠‘/’后jar启动访问就可以正常了
    }

     

  • 相关阅读:
    小球掉落
    String当中与转换相关常用的方法有
    字符串的截取方法
    golang 管道
    golang--协程之间通信的方式
    golang--goroutine
    go 时间操作
    吉格勒定理
    检视阅读
    git branch -a发现分支显示不全
  • 原文地址:https://www.cnblogs.com/lmq-1048498039/p/8094670.html
Copyright © 2011-2022 走看看