Author: igorz
Date: 2007-01-04 10:13:36 -0500 (Thu, 04 Jan 2007)
New Revision: 70482

Modified:
   trunk/mcs/class/System.Web/System.Web.J2EE/ChangeLog
   trunk/mcs/class/System.Web/System.Web.J2EE/PageMapper.cs
   trunk/mcs/class/System.Web/System.Web.Profile/ProfileParser.jvm.cs
Log:
TARGET_JVM: facultatively throw exception when loading profiles

Modified: trunk/mcs/class/System.Web/System.Web.J2EE/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.J2EE/ChangeLog        2007-01-04 
15:10:28 UTC (rev 70481)
+++ trunk/mcs/class/System.Web/System.Web.J2EE/ChangeLog        2007-01-04 
15:13:36 UTC (rev 70482)
@@ -1,3 +1,8 @@
+2007-01-04  Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * PageMapper.cs: refactoring: 
+       GetCachedType, GetObjectType - added overloads
+
 2006-08-20  Vladimir Krasnov <[EMAIL PROTECTED]>
 
        * BaseHttpServlet.cs: merged TLS fixes, workaround for thread problem

Modified: trunk/mcs/class/System.Web/System.Web.J2EE/PageMapper.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.J2EE/PageMapper.cs    2007-01-04 
15:10:28 UTC (rev 70481)
+++ trunk/mcs/class/System.Web/System.Web.J2EE/PageMapper.cs    2007-01-04 
15:13:36 UTC (rev 70482)
@@ -145,9 +145,13 @@
 
                public static Type GetObjectType(string url)
                {
-                       return GetCachedType(NormalizeName(url));
+                       return GetCachedType(NormalizeName(url), true);
                }
 
+               public static Type GetObjectType (string url, bool 
throwException) {
+                       return GetCachedType (NormalizeName (url), 
throwException);
+               }
+
                public static Assembly GetObjectAssembly(string url)
                {
                        return GetCachedAssembly(NormalizeName(url));
@@ -170,11 +174,14 @@
 
                        return t;
                }
-               private static Type GetCachedType(string url)
+               private static Type GetCachedType (string url) {
+                       return GetCachedType (url, true);
+               }
+               private static Type GetCachedType (string url, bool 
throwException)
                {
                        ICachedXmlDoc doc = 
PageMapper.GetAssembliesCachedDocument();                                       
    
                        Type t = doc.GetType(url);
-                       if (t == null)
+                       if (t == null && throwException)
                                throw new HttpException(404,"The requested 
resource (" + url + ") is not available.");
 
                        return t;

Modified: trunk/mcs/class/System.Web/System.Web.Profile/ProfileParser.jvm.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Profile/ProfileParser.jvm.cs  
2007-01-04 15:10:28 UTC (rev 70481)
+++ trunk/mcs/class/System.Web/System.Web.Profile/ProfileParser.jvm.cs  
2007-01-04 15:13:36 UTC (rev 70482)
@@ -50,7 +50,7 @@
                                //PageMapper call
                                string virtualPath = "~/App_Code/ProfileCommon";
                                string resolvedUrl = 
System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute 
(virtualPath).TrimEnd ('/');
-                               profileBaseType = PageMapper.GetObjectType 
(resolvedUrl);
+                               profileBaseType = PageMapper.GetObjectType 
(resolvedUrl, false);
                        }
                        return profileBaseType;
                }
@@ -61,8 +61,8 @@
                        if (profileGroupType == null) {
                                //PageMapper call
                                string virtualPath = "~/App_Code/ProfileGroup" 
+ groupName;
-                               string resolvedUrl = 
System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute 
(virtualPath).TrimEnd ('/');
-                               profileGroupType = PageMapper.GetObjectType 
(resolvedUrl);
+                               string resolvedUrl = 
System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute 
(virtualPath).TrimEnd ('/');
+                               profileGroupType = PageMapper.GetObjectType 
(resolvedUrl, false);
                        }
                        return profileGroupType;
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to