import javax.xml.transform.dom.DOMResult;\r
import javax.xml.transform.dom.DOMSource;\r
\r
+import org.argeo.slc.core.SlcException;\r
import org.springframework.oxm.Marshaller;\r
import org.springframework.web.servlet.view.xslt.XsltView;\r
import org.w3c.dom.Document;\r
\r
-import org.argeo.slc.core.test.tree.TreeTestResult;\r
-\r
public class XsltMarshallerView extends XsltView {\r
\r
private Marshaller marshaller;\r
\r
@Override\r
protected Class<?>[] getSourceTypes() {\r
- return new Class[] { TreeTestResult.class };\r
+ return new Class[] { Object.class };\r
}\r
\r
@Override\r
Document document = DocumentBuilderFactory.newInstance()\r
.newDocumentBuilder().newDocument();\r
DOMResult result = new DOMResult(document);\r
+ if (!marshaller.supports(source.getClass()))\r
+ throw new SlcException("Object of type " + source.getClass()\r
+ + " not supported.");\r
marshaller.marshal(source, result);\r
return new DOMSource(result.getNode());\r
}\r
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"
- default-lazy-init="true">
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean name="/home.web"
class="org.argeo.slc.web.mvc.admin.HomeController">
<import
resource="classpath:/org/argeo/slc/castor/spring/applicationContext.xml" />
- <bean name="/resultView.xslt"
- class="org.argeo.slc.web.mvc.result.ResultViewController">
- <constructor-arg ref="testResultDao" />
- <property name="viewName" value="resultView" />
- </bean>
-
<bean
class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
<property name="interceptors">