You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by rnon <ar...@yahoo.com> on 2007/08/17 19:19:09 UTC
absolute path for template file
the code:
Velocity.mergeTemplate("\\\\networkcomputer\\shared$\\template.vm", "UTF-8",
context, sw);
gives error:
SEVERE: ResourceManager : unable to find resource in any resource loader.
can someone gives me example of how to use absolute path?
I'm using velocity 1.5 and I see there's update on FileResourceLoader class
that allow usage of absolute path, but I don't know how to use it...
thank you for the help
--
View this message in context: http://www.nabble.com/absolute-path-for-template-file-tf4287074.html#a12203692
Sent from the Velocity - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
Re: absolute path for template file
Posted by Will Glass-Husain <wg...@gmail.com>.
Configuring the FileResourceLoader won't help. You could do to set a
relative path. (see the Developer's Guide).
You must have something wrong with your path. Can you access that path with
other Java programs?
WILL
On 8/17/07, rnon <ar...@yahoo.com> wrote:
>
>
> "/awrbc.txt" works fine
>
> I didn't do anything at all with FileResourceLoader ,
> how can I configure FileResourceLoader ? can someone post an example..
>
> thank you
>
>
> Will Glass-Husain-2 wrote:
> >
> > Did you configure the FileResourceLoader with a path? If so, you
> > shouldn't.
> >
> > I've never tried this with a UNC style path. Does something simple like
> > "/abc.txt" work? (should retrieve c:\abc.txt).
> >
> > Also, you may get better support on the user list. I'm responding to
> that
> > list.
> >
> > WILL
> >
> > On 8/17/07, rnon <ar...@yahoo.com> wrote:
> >>
> >>
> >> the code:
> >> Velocity.mergeTemplate("\\\\networkcomputer\\shared$\\template.vm",
> >> "UTF-8",
> >> context, sw);
> >> gives error:
> >> SEVERE: ResourceManager : unable to find resource in any resource
> loader.
> >>
> >>
> >> can someone gives me example of how to use absolute path?
> >> I'm using velocity 1.5 and I see there's update on
> >> FileResourceLoader class
> >> that allow usage of absolute path, but I don't know how to use it...
> >>
> >> thank you for the help
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/absolute-path-for-template-file-tf4287074.html#a12203692
> >> Sent from the Velocity - Dev mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> >> For additional commands, e-mail: dev-help@velocity.apache.org
> >>
> >>
> >
> >
> > --
> > Forio Business Simulations
> >
> > Will Glass-Husain
> > wglass@forio.com
> > www.forio.com
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Re%3A-absolute-path-for-template-file-tf4288057.html#a12207394
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
--
Forio Business Simulations
Will Glass-Husain
wglass@forio.com
www.forio.com
Re: absolute path for template file
Posted by rnon <ar...@yahoo.com>.
"/abc.txt" works fine
I didn't do anything at all with FileResourceLoader ,
how can I configure FileResourceLoader ? can someone post an example..
thank you
Will Glass-Husain-2 wrote:
>
> Did you configure the FileResourceLoader with a path? If so, you
> shouldn't.
>
> I've never tried this with a UNC style path. Does something simple like
> "/abc.txt" work? (should retrieve c:\abc.txt).
>
> Also, you may get better support on the user list. I'm responding to that
> list.
>
> WILL
>
> On 8/17/07, rnon <ar...@yahoo.com> wrote:
>>
>>
>> the code:
>> Velocity.mergeTemplate("\\\\networkcomputer\\shared$\\template.vm",
>> "UTF-8",
>> context, sw);
>> gives error:
>> SEVERE: ResourceManager : unable to find resource in any resource loader.
>>
>>
>> can someone gives me example of how to use absolute path?
>> I'm using velocity 1.5 and I see there's update on
>> FileResourceLoader class
>> that allow usage of absolute path, but I don't know how to use it...
>>
>> thank you for the help
>>
>> --
>> View this message in context:
>> http://www.nabble.com/absolute-path-for-template-file-tf4287074.html#a12203692
>> Sent from the Velocity - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: dev-help@velocity.apache.org
>>
>>
>
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> wglass@forio.com
> www.forio.com
>
>
--
View this message in context: http://www.nabble.com/Re%3A-absolute-path-for-template-file-tf4288057.html#a12207394
Sent from the Velocity - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: absolute path for template file
Posted by Will Glass-Husain <wg...@gmail.com>.
Did you configure the FileResourceLoader with a path? If so, you shouldn't.
I've never tried this with a UNC style path. Does something simple like
"/abc.txt" work? (should retrieve c:\abc.txt).
Also, you may get better support on the user list. I'm responding to that
list.
WILL
On 8/17/07, rnon <ar...@yahoo.com> wrote:
>
>
> the code:
> Velocity.mergeTemplate("\\\\networkcomputer\\shared$\\template.vm",
> "UTF-8",
> context, sw);
> gives error:
> SEVERE: ResourceManager : unable to find resource in any resource loader.
>
>
> can someone gives me example of how to use absolute path?
> I'm using velocity 1.5 and I see there's update on
> FileResourceLoader class
> that allow usage of absolute path, but I don't know how to use it...
>
> thank you for the help
>
> --
> View this message in context:
> http://www.nabble.com/absolute-path-for-template-file-tf4287074.html#a12203692
> Sent from the Velocity - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>
--
Forio Business Simulations
Will Glass-Husain
wglass@forio.com
www.forio.com
Re: absolute path for template file
Posted by rnon <ar...@yahoo.com>.
it works, thank you so much
Gonzalo Diethelm-2 wrote:
>
> I suggest you NEVER use the backslash character for path delimiters. As
> far as I know, C, C++, C# and Java all understand the forward slash as a
> path separator, with the benefits of portable code and not having to
> quote and re-quote the backslash. Therefore, try something
> like //netcomp/shared$/template.vm.
>
> Hope that helps. Best regards.
>
> On Fri, 2007-08-17 at 10:19 -0700, rnon wrote:
>
>> the code:
>> Velocity.mergeTemplate("\\\\networkcomputer\\shared$\\template.vm",
>> "UTF-8",
>> context, sw);
>> gives error:
>> SEVERE: ResourceManager : unable to find resource in any resource loader.
>>
>>
>> can someone gives me example of how to use absolute path?
>> I'm using velocity 1.5 and I see there's update on FileResourceLoader
>> class
>> that allow usage of absolute path, but I don't know how to use it...
>>
>> thank you for the help
>>
>
>
> --
> Gonzalo Diethelm
> gonzalo.diethelm@diethelm.org
>
>
--
View this message in context: http://www.nabble.com/absolute-path-for-template-file-tf4287074.html#a12236936
Sent from the Velocity - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
Re: absolute path for template file
Posted by Gonzalo Diethelm <go...@diethelm.org>.
I suggest you NEVER use the backslash character for path delimiters. As
far as I know, C, C++, C# and Java all understand the forward slash as a
path separator, with the benefits of portable code and not having to
quote and re-quote the backslash. Therefore, try something
like //netcomp/shared$/template.vm.
Hope that helps. Best regards.
On Fri, 2007-08-17 at 10:19 -0700, rnon wrote:
> the code:
> Velocity.mergeTemplate("\\\\networkcomputer\\shared$\\template.vm", "UTF-8",
> context, sw);
> gives error:
> SEVERE: ResourceManager : unable to find resource in any resource loader.
>
>
> can someone gives me example of how to use absolute path?
> I'm using velocity 1.5 and I see there's update on FileResourceLoader class
> that allow usage of absolute path, but I don't know how to use it...
>
> thank you for the help
>
--
Gonzalo Diethelm
gonzalo.diethelm@diethelm.org