Making simple web app work with Grasshopper.
authorEyal Alalouf <eyala@mainsoft.com>
Sun, 24 Jul 2005 15:52:53 +0000 (15:52 -0000)
committerEyal Alalouf <eyala@mainsoft.com>
Sun, 24 Jul 2005 15:52:53 +0000 (15:52 -0000)
svn path=/trunk/mcs/; revision=47607

mcs/class/System.Web/System.Web.J2EE/BaseHttpServlet.cs
mcs/class/System.Web/System.Web.J2EE/ChangeLog
mcs/class/System.Web/System.Web.J2EE/J2EEUtils.cs

index 6930b61a7ebec1a042923c489a03e044154329e0..d656a69e3ae660b5ec6e21204db63b493636412b 100644 (file)
@@ -88,6 +88,7 @@ namespace System.Web.J2EE
                                // Very important - to update Virtual Path!!!
                                AppDomain servletDomain = (AppDomain)this.getServletContext().getAttribute(J2EEConsts.APP_DOMAIN);
                                servletDomain.SetData(IAppDomainConfig.APP_VIRT_DIR, req.getContextPath());
+                               servletDomain.SetData(".hostingVirtualPath", req.getContextPath());
                                //put request to the TLS
                                Thread.SetData(_servletRequestSlot, req);
                                //put response to the TLS
@@ -180,7 +181,7 @@ namespace System.Web.J2EE
                                servletDomain.SetData(J2EEConsts.DESERIALIZER_CONST , this.GetDeserializer());
 
                                //servletDomain.SetData(".hostingVirtualPath", "/");
-                               //servletDomain.SetData(".hostingInstallDir", "/");
+                               servletDomain.SetData(".hostingInstallDir", "/");
                                return servletDomain;
                        }
                        catch(Exception e)
index 26ba094aceaf7a97978630aac613ec1807de5edd..5dd7ef67e89ce43c5af89e60f3d44e9c3d190366 100644 (file)
@@ -1,3 +1,7 @@
+2005-07-24  Eyal Alalouf  <eyala@mainsoft.com>\r
+    * BaseHttpServlet.cs: Set values of .hostingInstallDir & .hostingVirtualPath\r
+         necessary for integration.\r
+    * J2EEUtils.cs: Removed obsolete function FileExists\r
 2005-07-18  Eyal Alalouf  <eyala@mainsoft.com>\r
 \r
        * BaseHttpServlet.cs: Added file\r
index 47a71dc7c0d2fdc59b4cbe8d03aaa714d2f87426..c5d4d970b94b391f29a72ddaf83dc2e69643c4e8 100644 (file)
@@ -39,36 +39,6 @@ namespace System.Web.J2EE
                {
                }
 
-               public static bool FileExists(string fileName)
-               {
-                       //First reduce virtual or phys path
-                       if (fileName.StartsWith(IAppDomainConfig.WAR_ROOT_SYMBOL))
-                               fileName = fileName.Substring(IAppDomainConfig.WAR_ROOT_SYMBOL.Length);
-                       if (fileName.StartsWith(HttpRuntime.AppDomainAppVirtualPath + "/"))
-                               fileName = fileName.Substring(HttpRuntime.AppDomainAppVirtualPath.Length + 1);  
-                       if (fileName.StartsWith(HttpRuntime.AppDomainAppPath))
-                               fileName = fileName.Substring(HttpRuntime.AppDomainAppPath.Length);
-
-                       IResourceLoader resLoader = (IResourceLoader)AppDomain.CurrentDomain.GetData("GH_ResourceLoader");
-                       if (resLoader == null)
-                               throw new HttpException("Unexpected exception in GHUtils.FileExists method. Resource loader not initialized under current domain");
-
-                       java.net.URL res = resLoader.getResource(fileName);
-                       if (res == null)
-                       {
-                               if(fileName.StartsWith("/"))
-                                       fileName = fileName.Substring(1);
-                               java.lang.ClassLoader cl = (java.lang.ClassLoader)AppDomain.CurrentDomain.GetData("GH_ContextClassLoader");
-                               if (cl != null)
-                                       res = cl.getResource(fileName);
-                       }
-
-                       if (res == null)
-                               return false;
-
-                       return true;
-               }
-
                public static string GetApplicationRealPath(ServletConfig config) 
                {
                        string realFs = config.getInitParameter(J2EEConsts.FILESYSTEM_ACCESS);