Here is an example:
First you need to define a valid configuration like this:
Code:
<bean id="xsltController" class="com.company.app.MyController" />
<!-- View Resolver -->
<bean id="xsltViewResolver" class="org.springframework.web.servlet.view.xslt.XsltViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.xslt.XsltView"/>
<property name="prefix" value="/WEB-INF/xsl/"/>
<property name="suffix" value=".xsl"/>
</bean>
Then in your Controller you have to build a DOMSource and return a String with the name of your XSL-Transformation file located in the folder mentioned in the configuration above.
Code:
@RequestMapping
public String overview(Model model) {
model.addAttribute("obj", new DOMSource());
return "list";
}
That's all. Hope this helps.