zoukankan      html  css  js  c++  java
  • SpringBoot+SpringMvc页面跳转404问题

    当我们使用ModelAndView进行页面跳转出现404,有以下几个原因:

    1.modelAndView包引入错误,正确的包应该是( org.springframework.web.servlet.ModelAndView
    2.配置文件中前后缀没有配置

    spring: 
     freemarker:
        request-context-attribute: request
        prefix: /templates/
        suffix: .html
        content-type: text/html
        enabled: true
        cache: false
        charset: UTF-8

    3.没有引入相关依赖

       缺少:

     <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-thymeleaf</artifactId>
            </dependency>
  • 相关阅读:
    TS 3.1
    TS 3.1
    TS 3.1
    TS 3.1
    TS 3.1
    TS 3.1
    测试面试总结02
    测试出的缺陷(bug)
    测试用例的内容
    微信发红包测试要点
  • 原文地址:https://www.cnblogs.com/mylqm/p/14098286.html
Copyright © 2011-2022 走看看