Hi,

Actually, you can inject an initialized ResourceLoader into Velocity.

VelocityEngine.addProperty( *"resource.loader"*, *"sample"* );
VelocityEngine.setProperty( *"sample.resource.loader.instance"*, rl );

WILL

VelocityEngine.setProperty(

On Jan 22, 2008 8:21 PM, dreed <[EMAIL PROTECTED]> wrote:

>
> Sorry, just realized that this can be solved by setting the SessionFactory
> instance as a property, and retrieving it in the HibernateResourceLoader
> using the commonInit method. :-D
>
>
> dreed wrote:
> >
> > Hi All:
> >
> > I have written a custom resource loader that uses Hibernate to retrieve
> > VMs.  The ResourceLoader requires a Hibernate Session Factory to
> function.
> > In my specific case, I am using Spring, so I would like configure my
> > HibernateResourceLoader with an existing Hibernate SessionFactory and
> then
> > pass the instantiated and configured HibernateResourceLoader to be used
> by
> > the VelocityEngine.
> >
> > After looking through the source, it appears that RuntimeInstance
> attempts
> > to programatically instantiate each ResourceLoader during init,
> > specifically in the private initializeResourceManager() method, so that
> > instantiated ResourceLoaders can't be passed in (like with a
> > setResourceLoaders() method).  Is there any way around this?
> >
> > Thanks in advance for any suggestions.
> >
> > Dave
> >
>
> --
> View this message in context:
> http://www.nabble.com/Passing-Instantiated-Resource-Loaders-to-the-Runtime-Instance-tp15034266p15034464.html
> Sent from the Velocity - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com

Reply via email to