Author: igorz
Date: 2007-12-25 09:53:49 -0500 (Tue, 25 Dec 2007)
New Revision: 91878

Modified:
   trunk/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs
Log:
added TARGET_J2EE

Modified: 
trunk/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs
===================================================================
--- trunk/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs   
2007-12-25 14:52:20 UTC (rev 91877)
+++ trunk/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs   
2007-12-25 14:53:49 UTC (rev 91878)
@@ -67,8 +67,16 @@
                        HttpContext context = app.Context;
                        HttpRequest request = context.Request;
                        string contentType = request.ContentType;
-                       if (context.CurrentHandler is Page && 
!String.IsNullOrEmpty (contentType) && contentType.StartsWith 
("application/json", StringComparison.OrdinalIgnoreCase)) {
-                               IHttpHandler h = 
RestHandler.GetHandler(context, ((Page) context.CurrentHandler).GetType (), 
request.FilePath);
+                       Type pageType = context.CurrentHandler.GetType ();
+#if TARGET_J2EE
+                       if (!context.CurrentHandler is Page && 
context.CurrentHandler is IServiceProvider) {
+                               pageType = (Type) ((IServiceProvider) 
context.CurrentHandler).GetService (typeof (Type));
+                               if (pageType == null)
+                                       return;
+                       }
+#endif
+                       if (typeof (Page).IsAssignableFrom (pageType) && 
!String.IsNullOrEmpty (contentType) && contentType.StartsWith 
("application/json", StringComparison.OrdinalIgnoreCase)) {
+                               IHttpHandler h = RestHandler.GetHandler 
(context, pageType, request.FilePath);
                                h.ProcessRequest (context);
                                app.CompleteRequest ();
                        }

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

Reply via email to