java - Spring MVC Default View Resolver Not Working? -
i requests not resolve specific controller mappings go view name derived request path.
eg localhost/success
should end rendering view located @ /web-inf/view/freemarker/success.ftl
. gather spring documentation behaviour should enabled default, doesn't appear working setup.
<mvc:annotation-driven /> <mvc:interceptors> <!-- on pre-handle, resolve device originated web request --> <bean class="org.springframework.mobile.device.deviceresolverhandlerinterceptor" /> </mvc:interceptors> <!-- spring mobile --> <bean class="org.springframework.mobile.device.view.litedevicedelegatingviewresolver"> <constructor-arg> <!-- freemarker --> <bean id="viewresolver" class="org.springframework.web.servlet.view.freemarker.freemarkerviewresolver"> <property name="cache" value="false" /> <property name="prefix" value="" /> <property name="suffix" value=".ftl" /> </bean> </constructor-arg> <property name="mobileprefix" value="mobile/" /> <property name="tabletprefix" value="tablet/" /> </bean> <bean id="freemarkerconfig" class="org.springframework.web.servlet.view.freemarker.freemarkerconfigurer"> <property name="templateloaderpath" value="/web-inf/view/freemarker/" /> </bean>
turns out there no handlermapping
implementation found these requests, , dispatcherservlet
never called defaultrequesttoviewnametranslator
.
adding following provided appropriate handlermapping
, , filled in missing link. downside it's throwing exceptions logging @ severe requests can't satisfied, opposed dispatcherservlet
's more polite warning.
<mvc:view-controller path="/*" />
Comments
Post a Comment