2
0
Эх сурвалжийг харах

Making simple web app work with Grasshopper.

svn path=/trunk/mcs/; revision=47607
Eyal Alalouf 20 жил өмнө
parent
commit
6af66eb6bb

+ 2 - 1
mcs/class/System.Web/System.Web.J2EE/BaseHttpServlet.cs

@@ -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)

+ 4 - 0
mcs/class/System.Web/System.Web.J2EE/ChangeLog

@@ -1,3 +1,7 @@
+2005-07-24  Eyal Alalouf  <[email protected]>
+    * BaseHttpServlet.cs: Set values of .hostingInstallDir & .hostingVirtualPath
+	  necessary for integration.
+    * J2EEUtils.cs: Removed obsolete function FileExists
 2005-07-18  Eyal Alalouf  <[email protected]>
 
 	* BaseHttpServlet.cs: Added file

+ 0 - 30
mcs/class/System.Web/System.Web.J2EE/J2EEUtils.cs

@@ -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);