I have a client that wants to be able to display a totally different set of Velocity templates based on the Domain a user enters a web app. So completely different presentation layer but the same controllers, services, and database.
I've created an Interceptor that finds the domain and the domainDirectory where the velocity templates will live for said domain and puts it in session for a given user. I could do something like return 'new ModelAndView(domainDirectory + "/home");' but I would rather not have to edit all of my controllers if possible because I think things will quickly change. I'd like to dynamically change the Velocity resourceLoaderPath somehow based on the domain a user uses to get to the web application. I've done a lot of searching and read that the VelocityEngineFactoryBean may be what I need but cannot make it work. In my appname-servlet.xml I have the following: <bean id="velocityConfigurer" class="org.springframework.web.servlet.view.veloci ty.VelocityConfigurer"> <property name="resourceLoaderPath"> <value>WEB-INF/velocity</value> </property> </bean> <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEng ineFactoryBean"> <property name="velocityProperties"> <props> <prop key="resource.loader">class</prop> <prop key="class.resource.loader.class">org.apache.veloc ity.runtime.resource.loader.ClasspathResourceLoade r</prop> </props> </property> </bean> <bean id="domainInterceptor" class="com.somedomain.web.DomainInterceptor"> <property name="communityContextService"> <ref bean="communityContextService"/> </property> <property name="velocityEngine"> <ref bean="velocityEngine"/> </property> </bean> This does not work as my Interceptor complains of an setter error and I've reviewed and cannot resolve the problem. My real question is can the Velocity resourceLoaderPath be set dynamically by your web application? If so am I on the right track? -- View this message in context: http://www.nabble.com/Dynamic-Velocity-resourceLoaderPath-in-Spring--tf3061673.html#a8513803 Sent from the Velocity - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
