Set DataDirectory substitution string (http://blogs.msdn.com/dataaccess/archive/2005...
authorKonstantin Triger <kostat@mono-cvs.ximian.com>
Tue, 10 Oct 2006 13:47:24 +0000 (13:47 -0000)
committerKonstantin Triger <kostat@mono-cvs.ximian.com>
Tue, 10 Oct 2006 13:47:24 +0000 (13:47 -0000)
svn path=/trunk/mcs/; revision=66512

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

index 9dbd352ec6456b9011ca3b51416c10ee050a73dc..87932955462668e3b2a4b5f5e6be963c9c9e56fc 100644 (file)
@@ -45,6 +45,8 @@ namespace System.Web.J2EE
                static LocalDataStoreSlot _servletResponseSlot = Thread.GetNamedDataSlot(J2EEConsts.SERVLET_RESPONSE);
                static LocalDataStoreSlot _servletSlot = Thread.GetNamedDataSlot(J2EEConsts.CURRENT_SERVLET);
 
+               static String DataDirectory = String.Concat (System.IO.Path.DirectorySeparatorChar, "App_Data", System.IO.Path.DirectorySeparatorChar);
+
 
                public BaseHttpServlet()
                {
@@ -101,6 +103,8 @@ namespace System.Web.J2EE
                                AppDomain servletDomain = (AppDomain)this.getServletContext().getAttribute(J2EEConsts.APP_DOMAIN);
                                servletDomain.SetData(IAppDomainConfig.APP_VIRT_DIR, req.getContextPath());
                                servletDomain.SetData(".hostingVirtualPath", req.getContextPath());
+                               //Set DataDirectory substitution string (http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx)
+                               servletDomain.SetData ("DataDirectory", String.Concat (req.getContextPath (), DataDirectory));
 
                                // Put to the TLS current AppDomain of the servlet, so anyone can use it.
                                vmw.@internal.EnvironmentUtils.setAppDomain(servletDomain);