cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <andr...@apache.org>
Subject Re: [Flowscript] Obtaining servlet context directory
Date Wed, 10 Dec 2003 23:08:15 GMT
Joe Latty wrote:
> In your pipeline
>     <map:parameter name="context-path" value="{request:contextPath}"/>
> In flowscript
>     var contextPath = cocoon.parameters["context-path"];
> 

Thanks for your answer, but I don't mean the context
path of the request but the absolute filesystem path
to the web application directory.

-- Andreas

> ----- Original Message ----- 
> From: "Peter Velychko" <v_peter@ukr.net>
> To: "Andreas Hartmann" <users@cocoon.apache.org>
> Sent: Wednesday, December 10, 2003 11:49 PM
> Subject: Re: [Flowscript] Obtaining servlet context directory
> 
> 
> 
>>Hi,
>>
>>Excuse me I don't know about better way.
>>But my question is about context directory in case of application
>>works from WAR-archive.
>>
>>In that case if I have
>>var sourceFile =
> 
> Packages.org.apache.excalibur.source.SourceUtil.getFile(source);
> 
>>the "sourceFile" is null.
>>
>>Could anyone advice right way?
>>
>>Thanks a lot in advance.
>>
>>Andreas wrote:
>>
>>AH> Hi Cocoon users,
>>
>>AH> I'm looking for an easy way to obtain the directory
>>AH> of the servlet context in a flowscript. Is there any
>>AH> reason why context.getRealPath() in FOM_Cocoon is not
>>AH> (yet?) implemented?
>>
>>AH> By now I'm doing
>>
>>
>>AH> var sourceResolver = cocoon.getComponent(
>>AH>      Packages.org.apache.excalibur.source.SourceResolver.ROLE);
>>
>>AH> var source = sourceResolver.resolveURI("context:///");
>>AH> var sourceFile =
>>AH>      Packages.org.apache.excalibur.source.SourceUtil.getFile(source);
>>AH> var contextPath = sourceFile.getAbsolutePath();
>>
>>AH> sourceResolver.release(source);
>>AH> cocoon.releaseComponent(sourceResolver);
>>
>>
>>AH> Is there something shorter and more elegant?
>>
>>AH> Thanks in advance,
>>AH> -- Andreas
>>
>>
>>AH> ---------------------------------------------------------------------
>>AH> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>AH> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>Best regards,
>>Peter Velychko
>>v_peter@ukr.net
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message