ervalerio
Apr 28th, 2006, 08:03 AM
in my webapp I'd like to have both tiles aggregations (in the struts meaning of the term), and plain-old-jsp.
Then, i tried adding the following beans in my applicationContext.xml:
<bean id="tilesViewResolver" class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="order" value="0"/>
<property name="requestContextAttribute" value="requestContext"/>
<property name="viewClass"
value="org.springframework.web.servlet.view.tiles.TilesJs tlView"/>
</bean>
<bean id="jstlViewResolver"
class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
my hope was that when resolving a view, the tiles resolver is used first, and if no definition for the requested view is found, it tries to resolve it as a jsp. Unfortunatly, it doesn't work: when requesting main.html, which is not a tile definition, it doesn't find it.
is that they correct technique to chain view resolvers ?
thanks,
valerio
Then, i tried adding the following beans in my applicationContext.xml:
<bean id="tilesViewResolver" class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="order" value="0"/>
<property name="requestContextAttribute" value="requestContext"/>
<property name="viewClass"
value="org.springframework.web.servlet.view.tiles.TilesJs tlView"/>
</bean>
<bean id="jstlViewResolver"
class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
my hope was that when resolving a view, the tiles resolver is used first, and if no definition for the requested view is found, it tries to resolve it as a jsp. Unfortunatly, it doesn't work: when requesting main.html, which is not a tile definition, it doesn't find it.
is that they correct technique to chain view resolvers ?
thanks,
valerio