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: [EMAIL PROTECTED]
AH> For additional commands, e-mail: [EMAIL PROTECTED]


Best regards,
Peter Velychko                            
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to