You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Geir Magnusson Jr." <ge...@optonline.net> on 2002/03/23 15:25:45 UTC

Re: Can't load resources in Velocity using the ClasspathResourceLoader

On 3/22/02 6:31 PM, "Manish Khettry" <ma...@bdnacorp.com> wrote:

> 
> I'm trying to load a velocity template which I've placed in my classpath.
> 
> I set the property resource.loader.1.class to
> org.apache...ClasspathResourceLoader. When I try to make the call to get the
> template and it fails with a ResourceNotFoundException; i.e.

Whoa!  "resource.loader.1.class"?  That's pre version 1.0 notation.

Where did you find that?

The notation to use will be something like :

resource.loader = class

class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

(on one line, of course...)

See the examples/servlet_example2 on how to use this.

geir

-- 
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: Can't load resources in Velocity using the ClasspathResourceLoader

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 3/26/02 1:05 PM, "Manish Khettry" <ma...@bdnacorp.com> wrote:

> 
>> From the javadoc on the website!
> 
> http://jakarta.apache.org/velocity/api/org/apache/velocity/runtime/resource/
> loader/ClasspathResourceLoader.html

Ah - thx.  Fixed.

> 
> Also, does it need to be class.resource.loader.class or
> classpath.resource.loader.class?

The idea is that you specify the 'name' you want to refer to it as

 resource.loader = <name>

And then use that name

 <name>.resource.loader.class = <classname>


So I suggested 'class' as the <name> but you could use 'classpath' if you
wanted, or 'cucumber' if you really wanted to :)


> 
> Thanks
> Manish
> 
> 
> -----Original Message-----
> From: Geir Magnusson Jr. [mailto:geirm@optonline.net]
> Sent: Saturday, March 23, 2002 6:26 AM
> To: velocity-user@jakarta.apache.org
> Subject: Re: Can't load resources in Velocity using the
> ClasspathResourceLoader
> 
> 
> On 3/22/02 6:31 PM, "Manish Khettry" <ma...@bdnacorp.com> wrote:
> 
>> 
>> I'm trying to load a velocity template which I've placed in my classpath.
>> 
>> I set the property resource.loader.1.class to
>> org.apache...ClasspathResourceLoader. When I try to make the call to get
> the
>> template and it fails with a ResourceNotFoundException; i.e.
> 
> Whoa!  "resource.loader.1.class"?  That's pre version 1.0 notation.
> 
> Where did you find that?
> 
> The notation to use will be something like :
> 
> resource.loader = class
> 
> class.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> 
> (on one line, of course...)
> 
> See the examples/servlet_example2 on how to use this.
> 
> geir
> 
> --
> 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>
> 
> 

-- 
Geir Magnusson Jr.                                      geirm@optonline.net
System and Software Consulting
"Whoever would overthrow the liberty of a nation must begin by subduing the
freeness of speech." - Benjamin Franklin



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


RE: Can't load resources in Velocity using the ClasspathResourceLoader

Posted by Manish Khettry <ma...@bdnacorp.com>.
>>From the javadoc on the website!

http://jakarta.apache.org/velocity/api/org/apache/velocity/runtime/resource/
loader/ClasspathResourceLoader.html

Also, does it need to be class.resource.loader.class or
classpath.resource.loader.class?

Thanks
Manish


-----Original Message-----
From: Geir Magnusson Jr. [mailto:geirm@optonline.net]
Sent: Saturday, March 23, 2002 6:26 AM
To: velocity-user@jakarta.apache.org
Subject: Re: Can't load resources in Velocity using the
ClasspathResourceLoader


On 3/22/02 6:31 PM, "Manish Khettry" <ma...@bdnacorp.com> wrote:

>
> I'm trying to load a velocity template which I've placed in my classpath.
>
> I set the property resource.loader.1.class to
> org.apache...ClasspathResourceLoader. When I try to make the call to get
the
> template and it fails with a ResourceNotFoundException; i.e.

Whoa!  "resource.loader.1.class"?  That's pre version 1.0 notation.

Where did you find that?

The notation to use will be something like :

resource.loader = class

class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

(on one line, of course...)

See the examples/servlet_example2 on how to use this.

geir

--
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>