I can obtain a XML bean factory independent of ApplicationContext? Example
ApplicationContext def..
beans>
<!-- Definition if bean ReportFactory -->
<bean id="reportFactory" class="tgn.util.tld.ReportFactory">
<constructor-arg>
<value>reports- spring.xml</value>
</constructor-arg>
</bean>
</beans>
my XML reports reports- spring.xml
<beans>
<!-- Definicion del bean StringParameters -->
<bean id="stringParamBean" class="report.impl.StringParameter" singleton="false">
<property name="name"><value>Motocompresor</value></property>
<property name="id"><value>planta</value></property>
<property name="value"><value>Algo que decir</value></property>
<property name="required"><value>true</value></property>
</bean>
</bean>
The file of reports is in the Web-inf directory, but the objective is to load this xml when it is needed not like part of the context
My Class ReportFactory
....
public ReportFactory(String path){
this.path = path;
ClassPathResource res = new ClassPathResource(path);
factory=new XmlBeanFactory(res);
}
...
}
But when loading the application I obtain one exception, of file nonfound in class path
It is possible to do this?
Thankz Javier


Reply With Quote