This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In my application there is a scenario, we need the load the velocity template from database and file system as well. Some velocity template going to load from file system and some from database using dataSourceResourceLoader. we configured DataSourceResourceLoade, velocityEngine as follows, and use the VelocityEngine in Controller like below. Template are loading but when we set the name of view in ModelView object in controller class then it's goign to search from the file system, which is not available in file system, it's loaded from database. How can I mention in velocityCofig bean id to search from the loaded template from database?. is it possible to load the template from db and from file both in one module? I am using spring-1.0 version, with spring-webflow-1.0, hibernate3. Please help me out of this problem.
<bean id="dataSourceResourceLoader" class="org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader" singleton="true"> <property name="dataSource" ref="dataSource"/> <!-- bean id of "org.apache.commons.dbcp.BasicDataSource" copied from shared-data.xml --> </bean>