随笔分类 -  java

摘要:controller代码: 1 @RequestMapping("/success") 2 public String success(Map<String,Object> map){ 3 map.put("hello", "<h1>你好</h1>"); 4 map.put("users", Arr 阅读全文
posted @ 2020-09-15 22:14 山下明明子 阅读(249) 评论(0) 推荐(0)
摘要:在html文件中, 首先导入thymeleaf的名称空间 <html lang="en" xmlns:th="http://www.thymeleaf.org"> 然后先感受一下thymeleaf的语法--he: 先在controller中配置: 1 @Controller 2 public cla 阅读全文
posted @ 2020-09-15 17:48 山下明明子 阅读(142) 评论(0) 推荐(0)
摘要:首先导入thymeleaf: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 使用: 只要把HT 阅读全文
posted @ 2020-09-15 15:54 山下明明子 阅读(1755) 评论(0) 推荐(0)
摘要:1. /webjars/**, webjars后面的所有内容, 都去classpath:/META-INF/resources/webjars/下找资源; 如:localhost:8080/webjars/jquery/3.3.1/jquery.js 2. /**, 访问当前项目的任何资源,会在以下 阅读全文
posted @ 2020-09-14 23:04 山下明明子 阅读(201) 评论(0) 推荐(0)
摘要:1. IDEA新建maven项目 2. 在Spring官网 https://start.spring.io/ 设置好自己项目的配置后点击explore将生成的maven配置文件复制覆盖原本的pom文件 3. 在src/main/java目录下新建类home, 代码如下: 1 package com. 阅读全文
posted @ 2020-09-13 20:06 山下明明子 阅读(197) 评论(0) 推荐(0)