X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web.Extensions%2FSystem.Web.Handlers%2FScriptModule.cs;h=bf4bad4bfce183594ff96e3cfc37abf1a5a50c2a;hb=4323fbeaebf249f016dfdd6dc9b3b52a515f87c4;hp=9647615228018a8ff870f2b138b19b82ba2643f7;hpb=ed93ece32e2a76ae8ca75916e2c74f41c6a62540;p=mono.git diff --git a/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs b/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs index 96476152280..bf4bad4bfce 100644 --- a/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs +++ b/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs @@ -67,8 +67,16 @@ namespace System.Web.Handlers 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 (); } @@ -79,6 +87,10 @@ namespace System.Web.Handlers HttpContext context = app.Context; if (context.Request.Headers ["X-MicrosoftAjax"] == "Delta=true") { Page p = context.CurrentHandler as Page; +#if TARGET_J2EE + if (p == null && context.CurrentHandler is IServiceProvider) + p = (Page) ((IServiceProvider) context.CurrentHandler).GetService (typeof (Page)); +#endif if (p == null) return; ScriptManager sm = ScriptManager.GetCurrent (p);