You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Charles N. Harvey III" <ch...@alloy.com> on 2002/04/08 23:33:20 UTC

velstruts ?'s

I have been toying with the VelocityViewServlet with Struts and so far
everything looks good.  I am actually understanding it and making progress.
Thanks Gabe and Geir for a cool product and good docs.

I do have a question that I cannot figure out.

When I was using VelocityServlet I could do this in the props file:

---------------------------------------------------------------------------
resource.loader =
		url
url.resource.loader.description =
		Velocity Url Resource Loader
url.resource.loader.class =
		org.apache.velocity.runtime.resource.loader.URLResourceLoader
url.resource.loader.root =
		file:///c:/hosts/pcu/htdocs
url.resource.loader.cache =
		false
---------------------------------------------------------------------------


Now, I want to be able to do the same thing (specify any old random place
for my templates) but all I see is this:

---------------------------------------------------------------------------
resource.manager.class =
		org.apache.velocity.runtime.resource.ResourceManagerImpl
resource.manager.cache.class =
		org.apache.velocity.runtime.resource.ResourceCacheImpl
---------------------------------------------------------------------------

And I am just not sure of how to make it work.  I have tried all kinds of
combinations "resource.manager.root", "url.resource.loader.root".  They
don't
seem to be working, can't find my template.  Any insight as to why what I
have doesn't work would be great.

Thanks.

Charlie


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: velstruts ?'s

Posted by "Charles N. Harvey III" <ch...@alloy.com>.
So... is there any way for me to manually configure it now?
Or, is there some way I could do this differently?  I have a lot
of templates and I do not want them in /WEB-INF/...  I would like
to have them elsewhere on the filesystem (possibly on another machine).
So is there currently a way for me to configure this?

Thanks.

Charlie

> -----Original Message-----
> From: Gabriel Sidler [mailto:sidler@teamup.ch]
> Sent: Tuesday, April 09, 2002 6:46 AM
> To: Velocity Users List
> Subject: Re: velstruts ?'s
>
>
> You bring up a good point here. Currently, the resource loader is
> hard-coded in VelocityViewServlet. You cannot set it in the
> configuration file.
> It probaly should be changed such that I can be overwritten by
> the configuration file.
>
> Same thing applies to the logger.
>
> Geir, what do you think?
>
> Gabe
>
>
>
> Charles N. Harvey III wrote:
>
> > I have been toying with the VelocityViewServlet with Struts and so far
> > everything looks good.  I am actually understanding it and
> making progress.
> > Thanks Gabe and Geir for a cool product and good docs.
> >
> > I do have a question that I cannot figure out.
> >
> > When I was using VelocityServlet I could do this in the props file:
> >
> >
> ------------------------------------------------------------------
> ---------
> > resource.loader =
> > 		url
> > url.resource.loader.description =
> > 		Velocity Url Resource Loader
> > url.resource.loader.class =
> >
> org.apache.velocity.runtime.resource.loader.URLResourceLoader
> > url.resource.loader.root =
> > 		file:///c:/hosts/pcu/htdocs
> > url.resource.loader.cache =
> > 		false
> >
> ------------------------------------------------------------------
> ---------
> >
> >
> > Now, I want to be able to do the same thing (specify any old
> random place
> > for my templates) but all I see is this:
> >
> >
> ------------------------------------------------------------------
> ---------
> > resource.manager.class =
> > 		org.apache.velocity.runtime.resource.ResourceManagerImpl
> > resource.manager.cache.class =
> > 		org.apache.velocity.runtime.resource.ResourceCacheImpl
> >
> ------------------------------------------------------------------
> ---------
> >
> > And I am just not sure of how to make it work.  I have tried
> all kinds of
> > combinations "resource.manager.root", "url.resource.loader.root".  They
> > don't
> > seem to be working, can't find my template.  Any insight as to
> why what I
> > have doesn't work would be great.
> >
> > Thanks.
> >
> > Charlie
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
> .
>
>


--
--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: velstruts ?'s

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 4/9/02 6:56 PM, "Charles N. Harvey III" <ch...@alloy.com> wrote:

> I went in and made a hard-coded change to VelocityViewServlet and
> put in the url.resource.loader instead of the webapp.resource.loader.
> Works great.  Woo-hoo.  But, hard-coded bad.  If the webapp loader is
> the resource loader of choice I think I would like to know how to use it.

I think that you should have the choice to override that if you want.

I'll put something into VVS tonight for this...

> Basically, how do I specify where I have placed my templates?  Can I?
> Or must I keep templates in /WEB-INF/?  Where can I read up on the
> webapp loader?

You should be able to keep then anywhere in the webapp.

That's the point of it - so you don't have to configure anything, but just
keep the templates in the webapp.

For example, you should be able to keep them in the webapp root, and access
them like

  Template t = getTemplate("mytemplate.vm");

That simple...
 
> Thanks for the info.
> 
> Charlie
> 
>> -----Original Message-----
>> From: Geir Magnusson Jr. [mailto:geirm@optonline.net]
>> Sent: Tuesday, April 09, 2002 8:08 AM
>> To: velocity-user@jakarta.apache.org
>> Subject: Re: velstruts ?'s
>> 
>> 
>> On 4/9/02 6:46 AM, "Gabriel Sidler" <si...@teamup.ch> wrote:
>> 
>>> You bring up a good point here. Currently, the resource loader is
>>> hard-coded in VelocityViewServlet. You cannot set it in the
>>> configuration file.
>>> It probaly should be changed such that I can be overwritten by
>>> the configuration file.
>>> 
>>> Same thing applies to the logger.
>>> 
>>> Geir, what do you think?
>> 
>> I think it's valid and support the idea,  but it does make me think that
>> this takes VVS slightly afield of it's purpose, which was to be a drop in
>> for JspServlet - meaning that in JSP-land, you can just drop
>> things into the
>> webapp and invoke them, with output going to the servlet log.
>> 
>> Now, you would have to know about the local configuration.
>> 
>> While I think this is something we need to explicitly consider, I don't
>> think that it should stand in the way of the changes.  (Which would be
>> really easy...)
>> 
>> On the other hand, it's really cool that unlike JSP, you can move things
>> around like this :)
>> 
>> Geir
>> 
>>> 
>>> Gabe
>>> 
>>> 
>>> 
>>> Charles N. Harvey III wrote:
>>> 
>>>> I have been toying with the VelocityViewServlet with Struts and so far
>>>> everything looks good.  I am actually understanding it and
>> making progress.
>>>> Thanks Gabe and Geir for a cool product and good docs.
>>>> 
>>>> I do have a question that I cannot figure out.
>>>> 
>>>> When I was using VelocityServlet I could do this in the props file:
>>>> 
>>>> 
>> ------------------------------------------------------------------
>> ---------
>>>> resource.loader =
>>>> url
>>>> url.resource.loader.description =
>>>> Velocity Url Resource Loader
>>>> url.resource.loader.class =
>>>> org.apache.velocity.runtime.resource.loader.URLResourceLoader
>>>> url.resource.loader.root =
>>>> file:///c:/hosts/pcu/htdocs
>>>> url.resource.loader.cache =
>>>> false
>>>> 
>> ------------------------------------------------------------------
>> ---------
>>>> 
>>>> 
>>>> Now, I want to be able to do the same thing (specify any old
>> random place
>>>> for my templates) but all I see is this:
>>>> 
>>>> 
>> ------------------------------------------------------------------
>> ---------
>>>> resource.manager.class =
>>>> org.apache.velocity.runtime.resource.ResourceManagerImpl
>>>> resource.manager.cache.class =
>>>> org.apache.velocity.runtime.resource.ResourceCacheImpl
>>>> 
>> ------------------------------------------------------------------
>> ---------
>>>> 
>>>> And I am just not sure of how to make it work.  I have tried
>> all kinds of
>>>> combinations "resource.manager.root", "url.resource.loader.root".  They
>>>> don't
>>>> seem to be working, can't find my template.  Any insight as to
>> why what I
>>>> have doesn't work would be great.
>>>> 
>>>> Thanks.
>>>> 
>>>> Charlie
>>>> 
>>>> 
>>>> --
>>>> To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> 
>>>> .
>>>> 
>>>> 
>>> 
>> 
>> --
>> Geir Magnusson Jr.                                     geirm@optonline.net
>> System and Software Consulting
>> My inner cowboy needs to yodel.
>> 
>> 
>> --
>> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
Java : the speed of Smalltalk with the simple elegance of C++... 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: velstruts ?'s

Posted by "Charles N. Harvey III" <ch...@alloy.com>.
I went in and made a hard-coded change to VelocityViewServlet and
put in the url.resource.loader instead of the webapp.resource.loader.
Works great.  Woo-hoo.  But, hard-coded bad.  If the webapp loader is
the resource loader of choice I think I would like to know how to use it.
Basically, how do I specify where I have placed my templates?  Can I?
Or must I keep templates in /WEB-INF/?  Where can I read up on the
webapp loader?

Thanks for the info.

Charlie

> -----Original Message-----
> From: Geir Magnusson Jr. [mailto:geirm@optonline.net]
> Sent: Tuesday, April 09, 2002 8:08 AM
> To: velocity-user@jakarta.apache.org
> Subject: Re: velstruts ?'s
>
>
> On 4/9/02 6:46 AM, "Gabriel Sidler" <si...@teamup.ch> wrote:
>
> > You bring up a good point here. Currently, the resource loader is
> > hard-coded in VelocityViewServlet. You cannot set it in the
> > configuration file.
> > It probaly should be changed such that I can be overwritten by
> > the configuration file.
> >
> > Same thing applies to the logger.
> >
> > Geir, what do you think?
>
> I think it's valid and support the idea,  but it does make me think that
> this takes VVS slightly afield of it's purpose, which was to be a drop in
> for JspServlet - meaning that in JSP-land, you can just drop
> things into the
> webapp and invoke them, with output going to the servlet log.
>
> Now, you would have to know about the local configuration.
>
> While I think this is something we need to explicitly consider, I don't
> think that it should stand in the way of the changes.  (Which would be
> really easy...)
>
> On the other hand, it's really cool that unlike JSP, you can move things
> around like this :)
>
> Geir
>
> >
> > Gabe
> >
> >
> >
> > Charles N. Harvey III wrote:
> >
> >> I have been toying with the VelocityViewServlet with Struts and so far
> >> everything looks good.  I am actually understanding it and
> making progress.
> >> Thanks Gabe and Geir for a cool product and good docs.
> >>
> >> I do have a question that I cannot figure out.
> >>
> >> When I was using VelocityServlet I could do this in the props file:
> >>
> >>
> ------------------------------------------------------------------
> ---------
> >> resource.loader =
> >> url
> >> url.resource.loader.description =
> >> Velocity Url Resource Loader
> >> url.resource.loader.class =
> >> org.apache.velocity.runtime.resource.loader.URLResourceLoader
> >> url.resource.loader.root =
> >> file:///c:/hosts/pcu/htdocs
> >> url.resource.loader.cache =
> >> false
> >>
> ------------------------------------------------------------------
> ---------
> >>
> >>
> >> Now, I want to be able to do the same thing (specify any old
> random place
> >> for my templates) but all I see is this:
> >>
> >>
> ------------------------------------------------------------------
> ---------
> >> resource.manager.class =
> >> org.apache.velocity.runtime.resource.ResourceManagerImpl
> >> resource.manager.cache.class =
> >> org.apache.velocity.runtime.resource.ResourceCacheImpl
> >>
> ------------------------------------------------------------------
> ---------
> >>
> >> And I am just not sure of how to make it work.  I have tried
> all kinds of
> >> combinations "resource.manager.root", "url.resource.loader.root".  They
> >> don't
> >> seem to be working, can't find my template.  Any insight as to
> why what I
> >> have doesn't work would be great.
> >>
> >> Thanks.
> >>
> >> Charlie
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> >> <ma...@jakarta.apache.org>
> >>
> >> .
> >>
> >>
> >
>
> --
> Geir Magnusson Jr.                                     geirm@optonline.net
> System and Software Consulting
> My inner cowboy needs to yodel.
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: velstruts ?'s

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 4/9/02 6:46 AM, "Gabriel Sidler" <si...@teamup.ch> wrote:

> You bring up a good point here. Currently, the resource loader is
> hard-coded in VelocityViewServlet. You cannot set it in the
> configuration file.
> It probaly should be changed such that I can be overwritten by
> the configuration file.
> 
> Same thing applies to the logger.
> 
> Geir, what do you think?

I think it's valid and support the idea,  but it does make me think that
this takes VVS slightly afield of it's purpose, which was to be a drop in
for JspServlet - meaning that in JSP-land, you can just drop things into the
webapp and invoke them, with output going to the servlet log.

Now, you would have to know about the local configuration.

While I think this is something we need to explicitly consider, I don't
think that it should stand in the way of the changes.  (Which would be
really easy...)

On the other hand, it's really cool that unlike JSP, you can move things
around like this :)

Geir

> 
> Gabe
> 
> 
> 
> Charles N. Harvey III wrote:
> 
>> I have been toying with the VelocityViewServlet with Struts and so far
>> everything looks good.  I am actually understanding it and making progress.
>> Thanks Gabe and Geir for a cool product and good docs.
>> 
>> I do have a question that I cannot figure out.
>> 
>> When I was using VelocityServlet I could do this in the props file:
>> 
>> ---------------------------------------------------------------------------
>> resource.loader =
>> url
>> url.resource.loader.description =
>> Velocity Url Resource Loader
>> url.resource.loader.class =
>> org.apache.velocity.runtime.resource.loader.URLResourceLoader
>> url.resource.loader.root =
>> file:///c:/hosts/pcu/htdocs
>> url.resource.loader.cache =
>> false
>> ---------------------------------------------------------------------------
>> 
>> 
>> Now, I want to be able to do the same thing (specify any old random place
>> for my templates) but all I see is this:
>> 
>> ---------------------------------------------------------------------------
>> resource.manager.class =
>> org.apache.velocity.runtime.resource.ResourceManagerImpl
>> resource.manager.cache.class =
>> org.apache.velocity.runtime.resource.ResourceCacheImpl
>> ---------------------------------------------------------------------------
>> 
>> And I am just not sure of how to make it work.  I have tried all kinds of
>> combinations "resource.manager.root", "url.resource.loader.root".  They
>> don't
>> seem to be working, can't find my template.  Any insight as to why what I
>> have doesn't work would be great.
>> 
>> Thanks.
>> 
>> Charlie
>> 
>> 
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>> 
>> .
>> 
>> 
> 

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
My inner cowboy needs to yodel.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: velstruts ?'s

Posted by Gabriel Sidler <si...@teamup.ch>.
You bring up a good point here. Currently, the resource loader is
hard-coded in VelocityViewServlet. You cannot set it in the
configuration file.
It probaly should be changed such that I can be overwritten by
the configuration file.

Same thing applies to the logger.

Geir, what do you think?

Gabe



Charles N. Harvey III wrote:

> I have been toying with the VelocityViewServlet with Struts and so far
> everything looks good.  I am actually understanding it and making progress.
> Thanks Gabe and Geir for a cool product and good docs.
> 
> I do have a question that I cannot figure out.
> 
> When I was using VelocityServlet I could do this in the props file:
> 
> ---------------------------------------------------------------------------
> resource.loader =
> 		url
> url.resource.loader.description =
> 		Velocity Url Resource Loader
> url.resource.loader.class =
> 		org.apache.velocity.runtime.resource.loader.URLResourceLoader
> url.resource.loader.root =
> 		file:///c:/hosts/pcu/htdocs
> url.resource.loader.cache =
> 		false
> ---------------------------------------------------------------------------
> 
> 
> Now, I want to be able to do the same thing (specify any old random place
> for my templates) but all I see is this:
> 
> ---------------------------------------------------------------------------
> resource.manager.class =
> 		org.apache.velocity.runtime.resource.ResourceManagerImpl
> resource.manager.cache.class =
> 		org.apache.velocity.runtime.resource.ResourceCacheImpl
> ---------------------------------------------------------------------------
> 
> And I am just not sure of how to make it work.  I have tried all kinds of
> combinations "resource.manager.root", "url.resource.loader.root".  They
> don't
> seem to be working, can't find my template.  Any insight as to why what I
> have doesn't work would be great.
> 
> Thanks.
> 
> Charlie
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> .
> 
> 


-- 
--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>