<!-- 一定要放在viewResolver的前面,这样就先去找freemarker的 -->
<
bean
id
=
"freemarkerConfig"
class="org.springframework.web.servlet
.view.freemarker.FreeMarkerConfigurer">
<
property
name
=
"templateLoaderPath"
value
=
"/WEB-INF/ftl/"
/>
</
bean
>
<
bean
id
=
"viewResolver"
class="org.springframework.web.servlet
.view.freemarker.FreeMarkerViewResolver">
<
property
name
=
"cache"
value
=
"true"
/>
<
property
name
=
"prefix"
value
=
""
/>
<
property
name
=
"suffix"
value
=
".ftl"
/>
<
property
name
=
"contentType"
value
=
"text/html; charset=UTF-8"
/>
</
bean
>
<
bean
class="org.springframework.web.servlet
.view.InternalResourceViewResolver">
<
property
name
=
"viewClass"
value
=
"org.springframework.web.servlet.view.JstlView"
/>
<
property
name
=
"prefix"
value
=
"/WEB-INF/jsp/"
/>
<
property
name
=
"suffix"
value
=
".jsp"
/>
</
bean
>