Author: igorz
Date: 2008-01-30 04:45:26 -0500 (Wed, 30 Jan 2008)
New Revision: 94364

Modified:
   trunk/mcs/class/System.Web/System.Web/HttpException.cs
Log:
TARGET_J2EE:
customize default error message for portal

Modified: trunk/mcs/class/System.Web/System.Web/HttpException.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpException.cs      2008-01-30 
07:20:11 UTC (rev 94363)
+++ trunk/mcs/class/System.Web/System.Web/HttpException.cs      2008-01-30 
09:45:26 UTC (rev 94364)
@@ -161,10 +161,26 @@
                {
                        StringBuilder builder = new StringBuilder ();
                        WriteFileTop (builder, "Runtime Error");
-                       builder.Append (@"<p><strong>Description:</strong> An 
application error occurred on the server. The current custom error settings for 
this application prevent the details of the application error from being viewed 
remotely (for security reasons)." + (
 #if TARGET_J2EE //on portal we cannot know if we run locally
-                               !HttpContext.Current.IsServletRequest ? 
String.Empty :
+                       if (!HttpContext.Current.IsServletRequest)
+                               builder.Append (
+@"<p><strong>Description:</strong> An application error occurred on the 
server. The current custom error settings for this application prevent the 
details of the application error from being viewed (for security reasons).</p>
+<p><strong>Details:</strong> To enable the details of this specific error 
message to be viewable, please create a &lt;customErrors&gt; tag within a 
&quot;web.config&quot; configuration file located in the root directory of the 
current web application. This &lt;customErrors&gt; tag should then have its 
&quot;mode&quot; attribute set to &quot;Off&quot;.</p>
+<table class=""sampleCode""><tr><td><pre>
+
+&lt;!-- Web.Config Configuration File --&gt;
+
+&lt;configuration&gt;
+    &lt;system.web&gt;
+
+        &lt;customErrors mode=&quot;Off&quot;/&gt;
+    &lt;/system.web&gt;
+&lt;/configuration&gt;</pre>
+    </td></tr></table><br/>
+");
+                       else
 #endif
+                       builder.Append (@"<p><strong>Description:</strong> An 
application error occurred on the server. The current custom error settings for 
this application prevent the details of the application error from being viewed 
remotely (for security reasons)." + (
                                " It could, however, be viewed by browsers 
running on the local server machine.") 
                                + @"</p>
 <p><strong>Details:</strong> To enable the details of this specific error 
message to be viewable on remote machines, please create a &lt;customErrors&gt; 
tag within a &quot;web.config&quot; configuration file located in the root 
directory of the current web application. This &lt;customErrors&gt; tag should 
then have its &quot;mode&quot; attribute set to &quot;Off&quot;.</p>

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

Reply via email to