Hi,
I am trying to use jsp and freemarker together. The freemarker part works, but the jsp part does not because freemarker tries to find the corresponding template.
Configuration :
I thought that by putting the jsp part first, if spring finds a jsp file with the right name, it would output the jsp. If het jsp file does not exist, then it will look for the freemarker template. Clearly this is not happening. Also the order property (mentioned in the docs) is not available.Code:<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass"> <value> org.springframework.web.servlet.view.InternalResourceView </value> </property> <property name="prefix"> <value>/WEB-INF/jsp/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> <!-- freemarker config --> <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> <property name="templateLoaderPath" value="/WEB-INF/freemarker/" /> </bean> <bean id="freemarkerViewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"> <property name="cache" value="true" /> <property name="prefix" value="" /> <property name="suffix" value=".ftl" /> </bean>
Is there a way to solve this problem or should I just choose one of the two views ?
My second question is about how an url is mapped to a controller.
I would like to achieve that an url like :
http://localhost:8080/webapp/admin/ is mapped to a method named 'overview'. and an url like http://localhost:8080/webapp/admin/listall is mapped to a method named 'listall'.
I have a SimpleURLMapping with a propertyThe paramMultiController has a PropertiesMethodNameResolver configured like this :Code:<prop key="/admin/">paramMultiController</prop>
But this does not work. When browsing to http://localhost:8080/webapp/admin/anything, it says not found. While I thought a '*' as a property would bring me to the 'overview' method.Code:<prop key="/listall">listAllProducts</prop> <prop key="/*">overview</prop>
Any ideas ?
thanks a lot
Henk


Reply With Quote