Author: krasnov
Date: 2007-02-11 04:50:38 -0500 (Sun, 11 Feb 2007)
New Revision: 72609

Modified:
   trunk/mcs/class/System.Web/System.Web/ChangeLog
   trunk/mcs/class/System.Web/System.Web/HttpApplication.cs
Log:
* HttpApplication.cs: added exception pass through from processAction in j2ee 
portal

Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog     2007-02-11 09:34:27 UTC 
(rev 72608)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog     2007-02-11 09:50:38 UTC 
(rev 72609)
@@ -1,3 +1,8 @@
+2007-02-11  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * HttpApplication.cs: added exception pass through from processAction
+       in j2ee portal
+
 2007-02-02  Marek Habersack  <[EMAIL PROTECTED]>
 
        * HttpApplicationFactory.cs: make code a bit more compact.

Modified: trunk/mcs/class/System.Web/System.Web/HttpApplication.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpApplication.cs    2007-02-11 
09:34:27 UTC (rev 72608)
+++ trunk/mcs/class/System.Web/System.Web/HttpApplication.cs    2007-02-11 
09:50:38 UTC (rev 72609)
@@ -73,6 +73,10 @@
 using System.Web.Configuration;
 using System.Web.SessionState;
 using System.Web.UI;
+
+#if TARGET_J2EE
+using [EMAIL PROTECTED];
+#endif
        
 namespace System.Web {
 
@@ -770,6 +774,17 @@
                        if (error != null){
                                HttpResponse response = context.Response;
 
+#if TARGET_J2EE
+                               IPortletActionRequest actionRequest = 
context.ServletRequest as IPortletActionRequest;
+                               IPortletActionResponse actionResponse = 
context.ServletResponse as IPortletActionResponse;
+                               if (actionRequest != null && actionResponse != 
null && actionRequest.processActionOnly ()) {
+                                       string exception = "Exception of type " 
+ context.Error.GetType () + 
+                                               " during processAction: " + 
context.Error.Message + Console.Out.NewLine + 
+                                               context.Error.StackTrace;
+                                       actionResponse.setRenderParameter 
("vmw.action.exception", exception);
+                                       return;
+                               }
+#endif
                                if (!response.HeadersSent){
                                        response.ClearHeaders ();
                                        response.ClearContent ();
@@ -1162,6 +1177,19 @@
                        done.Reset ();
                        
                        begin_iar = new AsyncRequestState (done, cb, extraData);
+
+#if TARGET_J2EE
+                       IPortletRenderRequest renderRequest = 
context.ServletRequest as IPortletRenderRequest;
+                       if (renderRequest != null) {
+                               string actionException = 
context.ServletRequest.getParameter ("vmw.action.exception");
+                               if (actionException != null && 
actionException.Length > 0) {
+                                       FinalErrorWrite (context.Response, 
actionException.Replace("\n", "<br>"));
+                                       begin_iar.Complete ();
+                                       return begin_iar;
+                               }
+                       }
+#endif
+
 #if TARGET_JVM
                        if (true)
 #else

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

Reply via email to