-
簡(jiǎn)? ? ? ? ? ? ?介
查看全部 -
熱部署的配置
查看全部 -
jackson的基本用法
查看全部 -
了解:使用微服務(wù)SpringCloud和阿里的Dubbo的前提是使用SpringBoot。
SpringBOOT簡(jiǎn)介:微框架,與Spring4一起誕生??梢钥焖偕鲜郑狭艘恍┳禹?xiàng)目(開源框架或者第三方開源庫),直接引入即可,已經(jīng)做好了封裝。依賴很少配置就可以快速搭建并運(yùn)行項(xiàng)目。SpringBOOT可以創(chuàng)建獨(dú)立運(yùn)行的應(yīng)用而不依賴于容器(不需要打包成war包,可以放入tomcat中直接運(yùn)行)。
特點(diǎn):
提供Maven極簡(jiǎn)配置,缺點(diǎn)是會(huì)引入很多不需要的jar包。
簡(jiǎn)化配置,不用過多的xml配置(通過注解實(shí)現(xiàn)xml配置文件功能)
查看全部 -
https://github.com/leechenxiang/imooc-springboot-starter
查看全部 -
選擇框<option th:selected="${user.name eq 'Lee'}">Lee</option>,判斷是否是Lee,決定選擇框默認(rèn)展示什么
th:each="person:$userList}"
th:switch="${user.name}"
查看全部 -
th:if="${user.age} == 18"
gt????greater than? ?大于
lt????less than????????小于
ge????great and equal????大于等于
le????less and equal????????小于等于
查看全部 -
th:href="@{http://idcbgp.cn}"
<script th:src="@{/static/js/test.js}"></script> 引入js
<form th:action="@{/th/postform}" th:object="${user}" method="post" th:method="post">
? ? <input type="text" th:field="*{name}"/>
? ? <input type="text" th:field="*{age}"/>
? ? <input type="submit"/>
</form>
查看全部 -
th:id="${user.name}"
th:name
th:value="${#dates.format(user.birthday, 'yyyy-MM-dd')}"
th:object="${user}"? ? ?th:id="*{name}"
text和utext
th:text="${user.desc}"????????直接打印所有
th:utext="${user.desc}"????????html css會(huì)生效
查看全部 -
Whitelabel Error Page
原因一:helloworld類沒有和main方法所在的類在一個(gè)包下
原因二:
@RestController
@RequestMapping("/hello")
映射問題
查看全部 -
springboot:資源文件屬性配置可以通過注解映射到實(shí)體類,再將實(shí)體類注入到controller或者是service里去
查看全部 -
springboot修改tomcat配置查看全部
-
如果要用spring-boot-starter-parent2.0之后的版本 spring.thymeleaf.content-type 改為 spring.thymeleaf.servlet.content-type=text/html
查看全部 -
springboot整合模板引擎freemarker,thymeleaf
pom.xml 導(dǎo)入freemarker依賴
配置freemarker
查看全部 -
springboot:資源文件屬性配置可以通過注解映射到實(shí)體類,再將實(shí)體類注入到controller或者是service里去
首先,添加依賴
```
<dependency>
????<groupId>org.springframework.boot</groupId>
????<artifactId>spring-boot-configuration-processor</artifactId>
????<optional>true</optional>
</dependency>
```
建resource.properties文件
前綴:com.imooc.opensource;屬性:name,website,language
```
com.imooc.opensource.name=imooc
com.imooc.opensource.website=idcbgp.cn
com.imooc.opensource.language=java
```
創(chuàng)建實(shí)體類Resource,有name,website,language三個(gè)屬性,getter和setter方法
在Resource實(shí)體類頭部加注解
@Configration:代表此類會(huì)引用資源文件
@ConfigurationProperties(prefix="前綴") :?做映射時(shí),只把前綴后面的屬性映射到實(shí)體類的字段里去
@PropertySource(value="classpath:resource.properties"):要引用的資源文件的位置
查看全部
舉報(bào)