第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

sts中thymeleaf中顯示不出來

我在sts中使用thymeleaf頁(yè)面起不了作用呢

application中的配置

spring.thymeleaf.prefix=classpath:/templates/

spring.thymeleaf.suffix=.html

spring.thymeleaf.mode=HTML5

spring.thymeleaf.encoding=UTF-8

spring.thymeleaf.content-type=text/html

spring.thymeleaf.cache=false

html頁(yè)面

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8"/>

<title>Insert title here</title>

</head>

<body>

<h1 th:text="${hello}">Hello</h1>

</body>

</html>

控制器

@Controller

@EnableAutoConfiguration

public class StudentController {

@RequestMapping("/f")

public String free() {

Map<String,Object> map = new HashMap<String, Object>();

map.put("hello","user1");

return "freemarker/index";

}

}

}

頁(yè)面顯示不了user1

歡迎小伙伴速速解答



正在回答

1 回答

你頁(yè)面中可以獲取Map中的值,頁(yè)面一般應(yīng)該是獲取request域中的,在返回到頁(yè)面不重定向的情況下,重定向的情況,request域中的值會(huì)獲取不到,你這個(gè)直接返回到頁(yè)面,沒有把值放到request域中,或者放入model中也可

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

sts中thymeleaf中顯示不出來

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)