Juan José Vázquez Delgado skrev:
Daniel, very interesting but i´m not sure what you mean with:
"You need to configure a
org.springframework.web.servlet.view.InternalResourceViewResolver bean
with the prefix and suffix that needs to be added to the short
symbolic name to create the URL for the corresponding Cocoon view.".
Which should be the "Cocoon view"?. For example, with this configuration:
<bean id="viewResolver"
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>
If i want to use Cocoon views instead JstlView, what i should write as
"viewClass" property?
You don't need to have any value for the viewClass property. Its default
value for the InternalResourceViewResolver is the class
InternalResourceView, which just call a webapp internal resource
(servlet or JSP) through a request dispatcher.
So if the Cocoon sitemap servlet is mounted at "/cocoon-view/*" in the
servlet mapping in web.xml, and the sitemap has match rules with
"searchCriteria" etc as patterns, you just needs to configure the prefix
property in the viewResolver as "/cocoon-view/". And then it should work.
/Daniel