bug 10916
authorRoei Erez <roeie@mono-cvs.ximian.com>
Sun, 13 Jul 2008 08:49:13 +0000 (08:49 -0000)
committerRoei Erez <roeie@mono-cvs.ximian.com>
Sun, 13 Jul 2008 08:49:13 +0000 (08:49 -0000)
svn path=/trunk/mcs/; revision=107812

mcs/class/System.Web/System.Web.Configuration_2.0/AppSettings.jvm.cs

index da1a81e9ec9c8bd5d0f39ec8836aac3993464b3c..47fa9fd5d1fbbb3394b4b62393fd50aad288880b 100644 (file)
@@ -41,18 +41,20 @@ namespace System.Web.Configuration
                        : base (wrapped) {
                        _wrapped = wrapped;
 
-                       IServiceProvider provider = (IServiceProvider) ((IServiceProvider) hc).GetService (typeof (HttpWorkerRequest));
-                       ServletConfig config = (ServletConfig) provider.GetService (typeof (ServletConfig));
-                       ServletContext context = config.getServletContext ();
+                       ServletConfig config = (ServletConfig) AppDomain.CurrentDomain.GetData (vmw.common.IAppDomainConfig.SERVLET_CONFIG);
+                       if (config != null) {
+                               
+                               ServletContext context = config.getServletContext ();
 
-                       for (java.util.Enumeration e = context.getInitParameterNames (); e.hasMoreElements (); ) {
-                               string key = (string) e.nextElement ();
-                               Set (key, context.getInitParameter (key));
-                       }
+                               for (java.util.Enumeration e = context.getInitParameterNames (); e.hasMoreElements (); ) {
+                                       string key = (string) e.nextElement ();
+                                       Set (key, context.getInitParameter (key));
+                               }
 
-                       for (java.util.Enumeration e = config.getInitParameterNames (); e.hasMoreElements (); ) {
-                               string key = (string) e.nextElement ();
-                               Set (key, config.getInitParameter (key));
+                               for (java.util.Enumeration e = config.getInitParameterNames (); e.hasMoreElements (); ) {
+                                       string key = (string) e.nextElement ();
+                                       Set (key, config.getInitParameter (key));
+                               }
                        }
                }