// 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
servletDomain.SetData(J2EEConsts.DESERIALIZER_CONST , this.GetDeserializer());
//servletDomain.SetData(".hostingVirtualPath", "/");
- //servletDomain.SetData(".hostingInstallDir", "/");
+ servletDomain.SetData(".hostingInstallDir", "/");
return servletDomain;
}
catch(Exception e)
+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
{
}
- 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);