avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Tagunov <atagu...@mail.cnt.ru>
Subject Re[2]: [Patch] #13 resubmitted
Date Sat, 31 May 2003 07:06:24 GMT
Hello Berin!

AT> +    public void setContextDirectory( final URL url )

Further investigation has shown that this patch _is_ needed.
In fact, in a servlet I do

URL urlRoot = servletContext.getResource( "/WEB-INF/avalon" );
String stringRoot = urlRoot.toExternalFort();
FortressConfig.setContextDirectory( stringRoot );

and I get something like (writing by memory)
    file:/C:/file/D:\goj\t331ah\webapps\tst\WEB-INF\avalon
on Windows.

When however I first create a DefaultContext() and bind in
urlRoot as "context-root" to it and create FortressContext
on it then all is ok
    file:D:\goj\t331ah\webapps\tst\WEB-INF\avalon

So, I'm resending the patch.

- Anton

--- FortressConfig.orig 2003-05-29 09:59:36.000000000 +0400
+++ FortressConfig.java 2003-05-29 16:22:59.000000000 +0400
@@ -61,6 +61,7 @@
 import org.apache.excalibur.mpool.PoolManager;
 
 import java.io.File;
+import java.io.URL;
 
 /**
  * Helper class to create a m_context for the ContextManager.
@@ -212,6 +213,11 @@
         m_context.put( ContextManagerConstants.CONTEXT_DIRECTORY, new File( directory ) );
     }
 
+    public void setContextDirectory( final URL url )
+    {
+        m_context.put( ContextManagerConstants.CONTEXT_DIRECTORY, url );
+    }
+
     public void setLoggerCategory( final String category )
     {
         m_context.put( ContextManagerConstants.LOG_CATEGORY, category );


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message