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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

請(qǐng)問spring boot可以跟html一起使用嗎?

請(qǐng)問spring boot可以跟html一起使用嗎?

spring boot可以跟html一起使用嗎
查看完整描述

3 回答

?
蕪湖不蕪

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超7個(gè)贊

thymeleaf 與 jsp 同時(shí)使用 for spring mvc

spring-mvc.xml

[html] view plain copy
<!-- **************************************************************** -->
<!-- THYMELEAF-SPECIFIC ARTIFACTS -->
<!-- TemplateResolver <- TemplateEngine <- ViewResolver -->
<!-- **************************************************************** -->

<bean id="templateResolver"
class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
<property name="prefix" value="/WEB-INF/" />
<property name="suffix" value=".html" />
<property name="templateMode" value="HTML5" />
<!-- Template cache is true by default. Set to false if you want -->
<!-- templates to be automatically updated when modified. -->
<property name="cacheable" value="#{ systemProperties['thymeleaf.cacheable'] == 'false' ? false : true }" />
<property name="characterEncoding" value="utf-8"/>
</bean>

<bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver">
<property name="templateEngine">
<bean class="org.thymeleaf.spring4.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" />
</bean>
</property>
<property name="viewNames" value="thymeleaf/*"/>
<property name="order" value="0"/>
</bean>

<!-- jsp resolver -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/"/>
<property name="suffix" value=".jsp"/>
<property name="viewNames" value="jsps/*"/>
<property name="order" value="1"/>
<property name="cache" value="#{ systemProperties['jsp.cacheable'] == 'false' ? false : true }"/>
</bean>
加兩個(gè)屬性,

<property name="viewNames" value="thymeleaf/*"/>
<property name="viewNames" value="jsps/*"/>
ViewResolver 會(huì)根據(jù) viewName 選擇不同處理器。

另外開發(fā)時(shí)禁用紅緩存,每次重新解析模板,改動(dòng)立即生效。

<property name="cacheable" value="#{ systemProperties['thymeleaf.cacheable'] == 'false' ? false : true }" />



查看完整回答
反對(duì) 回復(fù) 2019-08-24
  • 3 回答
  • 0 關(guān)注
  • 865 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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