@RestController
@RequestMapping("dsd")
public class DataController extends BaseController {
    @RequestMapping("toindex")
    public ModelAndView toindex(Model model){
       /*  model.addAttribute("moudels",dataService.index());
         model.addAttribute("question",dataService.question());
         model.addAttribute("information",dataService.information());
         model.addAttribute("rank",dataService.indexRank());*/
        return new ModelAndView("index");
    }

 

如果是以为加上了它所以访问不到static下的资源了,这是应为你用themleaf引入css和js时的路径写错了,应该在你写的路径前加上/

 

  <link  th:href="@{/css/index.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/css/header.css}">
    <link rel="shortcut icon" th:href="@{/images/login.ico}" type="image/x-icon">
    <link rel="stylesheet" th:href="@{/font-awesome-4.7.0/css/font-awesome.min.css}">  

  这样加上后,就会发现页面的css,js能引入了

相关文章:

  • 2021-05-23
  • 2021-08-03
  • 2021-09-30
  • 2021-10-26
  • 2021-12-18
  • 2021-08-06
  • 2021-06-26
  • 2021-08-09
猜你喜欢
  • 2021-10-12
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-27
相关资源
相似解决方案