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. 分布式FastDfs+nginx缓存高可用集群构建

    介绍: FastDFS:开源的高性能分布式文件系统:主要功能包括:文件存储,文件同步和文件访问,以及高容量和负载平衡 FastDFS:角色:跟踪服务器(Tracker Server).存储服务器(St ...

  2. Screen.MousePointer 属性 (访问)

    可以使用鼠标指针以及屏幕对象属性可以指定或确定当前显示的鼠标指针的类型.读取/写入的整数. 语法     表达式.MousePointer 表达式 一个代表 Screen 对象的变量. 注解     ...

  3. Codeforces Round #567 (Div. 2)B. Split a Number (字符串,贪心)

    B. Split a Number time limit per test2 seconds memory limit per test512 megabytes inputstandard inpu ...

  4. mobilefacenet

    insightface作者训练的mobileFaceNet:    https://github.com/deepinsight/insightface/issues/214 ncnn的转换:http ...

  5. php内置函数分析array_diff()

    PHP_FUNCTION(array_diff) { zval *args; int argc, i; uint32_t num; HashTable exclude; zval *value; ze ...

  6. Arduino-数学函数

  7. Ubuntu 压缩文件命令

    tar -czvf name-of-archive.tar.gz /path/to/directory-or-file -c: Create an archive. -z: Compress the ...

  8. handy源码阅读(五):PollerBase类

    使用poll内核函数等待事件发生: struct PollerBase: private noncopyable { int64_t id_; int lastActive_; PollerBase( ...

  9. 51nod1730 涂边

    题目描述 题解 八级sb题 显然可以想到状压 枚举当前的宽度\(I\),设\(f[s]\)表示在当前的宽度下选的竖边的状态为s 再设\(g[s1][s2]\)表示状态s1转移到s2的方案数,枚举中间横 ...

  10. SQL—事物

    [选择题]以下哪个选项是DBMS的基本单位,是构成单一逻辑工作单元的操作集合. A.进程 B.SQL C.事务 D.文件 分析: (1)一个事务包含一个或多个SQL语句,是逻辑管理的工作单元(原子单元 ...