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. GUI学习之二十五——QFontDialog学习总结

    今天学习字体对话框——QFontDialog()控件. QFontDialog()是继承自QDialog()的一个子类,用来选择给定的字体(包括字体.字号.样式等) 一.构造函数 QFontDialo ...

  2. 【CF838E】 Convex Countour

    [CF838E] Convex Countour 首先观察题目的性质 由于是凸包,因此不自交路径中的一条边\((x, y)\)的两端点只能向与\(x\)或\(y\)相邻的结点连边. 举个栗子,若选取了 ...

  3. 【JavaScript】数组方法之基础方法

    数组方法之基础方法 Array 对象属性 属性 描述 constructor 返回对创建此对象的数组函数的引用. length 设置或返回数组中元素的数目. prototype 使您有能力向对象添加属 ...

  4. LTE系统时延及降低空口时延的4种方案

    转载:https://rf.eefocus.com/article/id-LTE%20delay 对于移动通信业务而言,最重要的时延是端到端时延, 即对于已经建立连接的收发两端,数据包从发送端产生,到 ...

  5. CopyOnWrite 个人理解以及应用

    缘由 最近在看<Redis 设计与实现>,看到Redis的执行bgsave生成dump.rdb是根据CopyOnWrite的 之前也不是很懂为啥要有CopyOnWrite这个东西 翻看文章 ...

  6. HDU 1134 Game of Connections(卡特兰数+大数模板)

    题目代号:HDU 1134 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1134 Game of Connections Time Limit: 20 ...

  7. 使用JLDAP操作LDAP,包含匿名连接、ldif导入导出、获取根节点、对数据的操作、LDAP错误码解析等

    bean类 package com.cn.ccc.ggg.ldap.model; import javax.persistence.Entity; import javax.persistence.T ...

  8. [CSP-S模拟测试]:简单的序列(DP)

    题目描述 从前有个括号序列$s$,满足$|s|=m$.你需要统计括号序列对$(p,q)$的数量. 其中$(p,q)$满足$|p|+|s|+|q|=n$,且$p+s+q$是一个合法的括号序列. 输入格式 ...

  9. [BZOJ2822]:[AHOI2012]树屋阶梯(卡特兰数)

    题目传送门 题目描述 暑假期间,小龙报名了一个模拟野外生存作战训练班来锻炼体魄,训练的第一个晚上,教官就给他们出了个难题.由于地上露营湿气重,必须选择在高处的树屋露营.小龙分配的树屋建立在一颗高度为N ...

  10. 最近使用的两个工具 winscp和xshell

    最近在编译MONO源码时用到了这两个工具,感觉挺好,记录备忘 WINSCP 长这样 用于可视化的查看和操作远程服务器上的文件 xshell用于命令行下操作远程服务器,服务器的同学好多在用这个.命令行是 ...