Yes, you can get an absolute path , my code is something like this:

URL url =
ServiceUtil.class.getClassLoader().getResource(ServiceConstants.TEMPLATE_DIR+ServiceConstants.STAMP_TEMPLATE_FILE);

String path = url.getPath();

And the path i get is:
file:/C:/[..path_to_tomcat..]/work/Catalina/localhost/axis2/_axis2/myService.aar!/templates/template.ftl

which is correct, the file is there, but it seems that freemarker cannot
resolve it right.

I dont think this is Axis2 fault, so i'll do a bit more search on FreeMarker
:-)











Grimm, Markus wrote:
> 
> Hi,
> 
> what doesn't work?
> Don't you get an url or can't you do anything with it?
> 
>  
> 
> -----Ursprüngliche Nachricht-----
> Von: VTARIN [mailto:[EMAIL PROTECTED] 
> Gesendet: Dienstag, 16. September 2008 11:27
> An: [email protected]
> Betreff: Re: Path to a resource inside an aar
> 
> 
> Already tried it, doesnt work :-(
> 
> A solution ive found is to get the resource as stream and save it to a
> temp
> file (yes, thats a bit dirty :-)). Then i use the path to that temp file
> located outside the aar.
> 
> 
> Thanks for your reply.
> 
> 
> 
> VTARIN wrote:
>> 
>> Hello,
>> 
>> I have a service packaged and deployed as an aar archive. Inside it , i
>> have a freemarker template which is used by the service. 
>> 
>> When i try to load the template (only can do it by passing a path as
>> parameter), the file is never found, whatever path i use. Is there any
>> way
>> to access this template using a path ? 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Path-to-a-resource-inside-an-aar-tp19506606p19508356.html
> Sent from the Axis - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Path-to-a-resource-inside-an-aar-tp19506606p19508666.html
Sent from the Axis - User mailing list archive at Nabble.com.

Reply via email to