Re: Re[4]: Custom Resource Loader

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Re[4]: Custom Resource Loader

Shinobu Kawai
## remembered an old posting...

> I'm wondering how we might leverage the two pieces (Spring and Toolbox) so
> that Spring can add pre-wired objects into the VContext.

Any solutions yet?  I'm all ears.  :)

And here's a great place to put it:
   http://wiki.apache.org/jakarta-velocity/VelocityAndSpringTips

Best regards,
-- Shinobu

--
Shinobu Kawai <[hidden email]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Servlet Resource Loader: Webapp, then classpath

Eric Fixler-4
Hi all.  I'm doing a Velocity/Struts app, and I'd like to set up  
VelocityViewServlet so that, in response to a template request, it  
first tries the WebappResourceLoader, and then, if there's no  
appropriate document there, a ClasspathResourceLoader.

Looking at VelocityViewServlet, it doesn't look possible, but I've  
seen other apps that seem to have the behavior I want, i.e. try the  
regular templates path first, and, if nothings there, check in WEB-
INF/class or the jar files in WEB-INF/lib.

Can anyone suggest how I might go about doing this?  Do I need a  
custom resource loader?  Does one exist that works as I described?

thanks
eric


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Servlet Resource Loader: Webapp, then classpath

Nathan Bubna
you should be able to configure your velocity.properties as you would
with any other velocity application.  yours will look someting like

resource.loader=webapp,classpath
webapp.resource.loader.class=...WebappLoader
classpath.resource.loader.class=...ClasspathResourceLoader

and so on...

be sure to tell the VelocityViewServlet to use your custom
velocity.properties file by specifying its path in your init-params.

On 5/31/05, Eric Fixler <[hidden email]> wrote:

> Hi all.  I'm doing a Velocity/Struts app, and I'd like to set up
> VelocityViewServlet so that, in response to a template request, it
> first tries the WebappResourceLoader, and then, if there's no
> appropriate document there, a ClasspathResourceLoader.
>
> Looking at VelocityViewServlet, it doesn't look possible, but I've
> seen other apps that seem to have the behavior I want, i.e. try the
> regular templates path first, and, if nothings there, check in WEB-
> INF/class or the jar files in WEB-INF/lib.
>
> Can anyone suggest how I might go about doing this?  Do I need a
> custom resource loader?  Does one exist that works as I described?
>
> thanks
> eric
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Servlet Resource Loader: Webapp, then classpath

Eric Fixler-4
Thanks Nathan!

eric



On May 31, 2005, at 14:00, Nathan Bubna wrote:

> you should be able to configure your velocity.properties as you would
> with any other velocity application.  yours will look someting like
>
> resource.loader=webapp,classpath
> webapp.resource.loader.class=...WebappLoader
> classpath.resource.loader.class=...ClasspathResourceLoader
>
> and so on...
>
> be sure to tell the VelocityViewServlet to use your custom
> velocity.properties file by specifying its path in your init-params.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]