springboot

cmd运行springboot项目:

mvn springboot:run

mvn install

cd target

java -jar girl-0.0.1-SNAPSHOT.jar

2.构建sprignboot项目

1.gradle +springboot 2.1.2 https://start.spring.io/

2.编译运行cmd-build successful

java -version

gradle -v

cd D:\codes\IDEA\initialize-start

d:

gradle build

java -jar build/libs/initialize-start-1.0.0.jar

3.Junit test,status()、content()报错

public class HelloControllerTest {

	@Autowired
	private MockMvc mockMvc;
	@Test
	public void testHello() throws Exception {
		
		mockMvc.perform(MockMvcRequestBuilders.get("/hello").accept(MediaType.APPLICATION_JSON))
		.andExpect(status().isOk())
		.andExpect(content().string(equalTo("Hello World")));
	}

}

  
导入:

import static org.hamcrest.Matchers.equalTo;  
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;  
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;


4.springboot项目三种运行方式

java -jar build/libs/initialize-start-1.0.0.jar

java Application

spring Boot Gradle Plugin

cd D:\codes\IDEA\hello-world

d:

gradle bootRun

gradlew bootRun

 

5.thymeleaf的属性优先级,Thymeleaf相关文档:https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#introducing-thymeleaf

优先级标签
1

th:include

th:replace

2th:each
3

th:if

th:unless

th:switch

th:case

4

th:object

th:with

5

th:attr

th:attrprepend

th:attrappend

6

th:value,th:href,th.src,etc

7

th:text

th:utext

8

th:fragment

9th:remove

6.thymeleaf无法识别标签th:

<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">

 

7.Eclipse无法识别中文的问题

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值