Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sat Dec 07 20:12:22 CST 2019
There was an unexpected error (type=Not Found, status=404).
No message available
 
 
错误写法1:
<a th:href="register.html">注册</a>

错误写法2:

<a href="register.html">注册</a>
正确写法:
<a th:href="@{register}">注册</a>
并且!!!!!!直接通过超链接跳转是成功不了的。
在Controller增加了后台处理方法,直接返回html:
    @RequestMapping("/register")
    public String toRegister(){
        return "register";
    }

注意:

1. 要用RequestMapping

2. application.properties中有关配置如下:

## thymeleaf
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.servlet.content-type=text/html
spring.thymeleaf.cache=false
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.check-template-location=true

【报错】springboot thymeleaf超链接跳转 404的更多相关文章

  1. idea中的springboot+gradle项目报错springboot configuration annotation processor not found in classpath

    idea中的springboot项目,打开某个类run.halo.app.config.properties.HaloProperties.java,报错(使用gradle编译): springboo ...

  2. 关于springboot启动时候报错:springboot Failed to parse configuration class [Application]

    把运行的java类放在一个package下后就不再提示这个错误. 使用的ide是intellij,之前也有因为没有创建package报错的经历,可能这是intellij必须的

  3. 为什么这个地方用重定向会报错.只能用 服务器跳转?? 为什么我加了过滤器,还是能直接登陆 servlet

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, ...

  4. springboot + thymeleaf静态资源访问404

    在使用springboot 和thtmeleaf开发时引用静态资源404,静态资源结如下: index.html文件: <!DOCTYPE html> <html xmlns:th= ...

  5. spring boot + thymeleaf 报错 org.thymeleaf.exceptions.TemplateInputException

    org.thymeleaf.exceptions.TemplateInputException: Error resolving template "admin/verifyPassword ...

  6. 【报错】The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

    提交表单之后, 报错页面显示: HTTP Status 404 – 未找到 Type Status Report 消息 Not found 描述 The origin server did not f ...

  7. MySQL--18 报错总结

    报错1: 报错原因:MySQL的socket文件目录不存在. 解决方法: 创建MySQL的socket文件目录 mkdir /application/mysql-5.6.38/tmp 报错2: 报错原 ...

  8. 【技术贴】解决支付宝充值信用卡还款跳转到网上银行报错Error 404 - Not Found

    声明 : 本文在 GFDL 1.2 下发布,本文出处光大银行信用卡  http://bbs.090989.com/forum-186-1.html http://androidgao.blogspot ...

  9. Springboot解决资源文件404,503等特殊报错,无法访问

    Springboot解决资源文件404,503等特殊报错 原文链接:https://www.cnblogs.com/blog5277/p/9324609.html 原文作者:博客园--曲高终和寡 ** ...

随机推荐

  1. 图像语义分割出的json文件和原图,用plt绘制图像mask

    1.弱监督 由于公司最近准备开个新项目,用深度学习训练个能够自动标注的模型,但模型要求的训练集比较麻烦,,要先用ffmpeg从视频中截取一段视频,在用opencv抽帧得到图片,所以本人只能先用语义分割 ...

  2. Java语言基础1-关键字、标识符、常量和变量

    关键字-标识符-常量和变量-运算符-流程控制-方法-数组 1.关键字 keyword Java系统中已经赋予了特殊含义的单词 特点:全部是小写字母注意: Java中的保留字:现在没有使用,以后有可能会 ...

  3. mysql的安装和简单的操作

    一.MySQL的安装和简单操作 1.了解MySQL MySQL有两个软件 ---服务器软件     - socket服务端     - 本地文件操作 - 解析指令(mysql语句)---客户端软件   ...

  4. 【leetcode】Champagne Tower

    题目如下: 解题思路:本题如果用递归来做,思路会非常清晰.每个杯子得到的总的香槟的数量,减去自身杯子容量后,多余的部分均分成两部分,下层的两个杯子各得一半,但是这种解法在输入香槟较大的情况下会导致超时 ...

  5. vue引入css和js的方法

    1.引入js的话 require('地址') imgport xxx from ‘src’ import xxx 2.引入css @import ‘  ’

  6. handy源码阅读(四):Channel类

    通道,封装了可以进行epoll的一个fd. struct Channel: private noncopyable { Channel(EventBase* base, int fd, int eve ...

  7. 尝试用了一哈wepy框架的感想

    恶心死我, 1 在项目里出现了中文乱码(utf-8在wpy文件里有中文和注释--编译后就转化成乱码, 把代码拷在另外的项目里,(该项目没有中文乱码现象,)编译出来就出现中文乱码, 然后我再在所拷的代码 ...

  8. spring boot不要放在tomcat下启动,因为自身就带了集成tomcat

    spring boot不要放在tomcat下启动,因为自身就带了集成tomcat

  9. B/S大文件下载+断点续传

    1.先将 webuploader-0.1.5.zip 这个文件下载下来:https://github.com/fex-team/webuploader/releases  根据个人的需求放置自己需要的 ...

  10. 【bozj2287】【[POJ Challenge]消失之物】维护多值递推

    (上不了p站我要死了) Description ftiasch 有 N 个物品, 体积分别是 W1, W2, -, WN. 由于她的疏忽, 第 i 个物品丢失了. "要使用剩下的 N - 1 ...