You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Quang Thai Le <qt...@yahoo.com> on 2008/01/16 13:39:00 UTC
Velocity problem while parsing a template file located on hardisk
Dear all,
I've a template file located on hardisk (I must place my vm files outside my webapp as customer asked). Now, I try to parse it by using directive #parse as following:
#parse ("D:/temp/myTemplateFile.vm")
Unfortunately, the system throws an ResourceNotFoundException exception.
I tried another solution as below:
- define loader path in velocity.properties:
resource.loader=file
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path=D:/temp/
file.resource.loader.cache=true
file.resource.loader.modificationCheckInterval=10
- try #parse("myTemplateFile.vm")
I always have an ResourceNotFoundException.
Could you please help me?
Many thanks.
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
Re: Velocity problem while parsing a template file located on hardisk
Posted by Nathan Bubna <nb...@gmail.com>.
If the file.resource.loader.path is already set to D:/temp/ then you
should only need to do
#parse( 'myTemplateFile.vm' )
On Jan 16, 2008 4:39 AM, Quang Thai Le <qt...@yahoo.com> wrote:
> Dear all,
>
> I've a template file located on hardisk (I must place my vm files outside my webapp as customer asked). Now, I try to parse it by using directive #parse as following:
> #parse ("D:/temp/myTemplateFile.vm")
> Unfortunately, the system throws an ResourceNotFoundException exception.
>
> I tried another solution as below:
> - define loader path in velocity.properties:
>
> resource.loader=file
> file.resource.loader.description = Velocity File Resource Loader
> file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
> file.resource.loader.path=D:/temp/
> file.resource.loader.cache=true
> file.resource.loader.modificationCheckInterval=10
>
> - try #parse("myTemplateFile.vm")
>
> I always have an ResourceNotFoundException.
>
> Could you please help me?
>
> Many thanks.
>
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Velocity problem while parsing a template file located on
hardisk
Posted by csanders <cs...@hoovers.com>.
Are you calling init() with the path to the properties file ?
On Wed, 2008-01-16 at 04:39 -0800, Quang Thai Le wrote:
> Dear all,
>
> I've a template file located on hardisk (I must place my vm files outside my webapp as customer asked). Now, I try to parse it by using directive #parse as following:
> #parse ("D:/temp/myTemplateFile.vm")
> Unfortunately, the system throws an ResourceNotFoundException exception.
>
> I tried another solution as below:
> - define loader path in velocity.properties:
>
> resource.loader=file
> file.resource.loader.description = Velocity File Resource Loader
> file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
> file.resource.loader.path=D:/temp/
> file.resource.loader.cache=true
> file.resource.loader.modificationCheckInterval=10
>
> - try #parse("myTemplateFile.vm")
>
> I always have an ResourceNotFoundException.
>
> Could you please help me?
>
> Many thanks.
>
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org