cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Velychko <>
Subject Re: [Flowscript] Obtaining servlet context directory
Date Wed, 10 Dec 2003 12:49:31 GMT

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 =;
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> var source = sourceResolver.resolveURI("context:///");
AH> var sourceFile =
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:
AH> For additional commands, e-mail:

Best regards,
Peter Velychko                   

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message