Author: kostat
Date: 2007-04-22 05:40:36 -0400 (Sun, 22 Apr 2007)
New Revision: 76050

Modified:
   trunk/mcs/class/System.Web/System.Web.J2EE/J2EEUtils.cs
   trunk/mcs/class/System.Web/System.Web.UI/Page.jvm.cs
Log:
add mainsoft.use.portlet.namespace configuration parameter suppressing adding 
portlet namespace to the control id

Modified: trunk/mcs/class/System.Web/System.Web.J2EE/J2EEUtils.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.J2EE/J2EEUtils.cs     2007-04-21 
23:48:39 UTC (rev 76049)
+++ trunk/mcs/class/System.Web/System.Web.J2EE/J2EEUtils.cs     2007-04-22 
09:40:36 UTC (rev 76050)
@@ -30,11 +30,23 @@
 using vmw.common;
 using System.ComponentModel;
 using System.Threading;
+using javax.servlet;
 
 namespace System.Web.J2EE
 {
        internal static class J2EEUtils
        {
+               public static string GetInitParameterByHierarchy (ServletConfig 
config, string name) {
+                       if (config == null)
+                               throw new ArgumentNullException ("config");
+
+                       string value = config.getInitParameter (name);
+                       if (value != null)
+                               return value;
+
+                       return config.getServletContext ().getInitParameter 
(name);
+               }
+
                public static int RunProc(string[] cmd)
                {       
                        java.lang.Runtime rt = java.lang.Runtime.getRuntime();

Modified: trunk/mcs/class/System.Web/System.Web.UI/Page.jvm.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Page.jvm.cs        2007-04-21 
23:48:39 UTC (rev 76049)
+++ trunk/mcs/class/System.Web/System.Web.UI/Page.jvm.cs        2007-04-22 
09:40:36 UTC (rev 76050)
@@ -31,6 +31,8 @@
 using System.Collections.Specialized;
 using System.Globalization;
 using System.Web.Hosting;
+using System.Web.J2EE;
+using System.ComponentModel;
 
 namespace System.Web.UI
 {
@@ -55,8 +57,11 @@
 
                                if (_PortletNamespace == null) {
                                        IPortletResponse portletResponse = null;
-                                       if (Context != null)
-                                               portletResponse = 
Context.ServletResponse as IPortletResponse;
+                                       if (Context != null) {
+                                               string usePortletNamespace = 
J2EEUtils.GetInitParameterByHierarchy (Context.Servlet.getServletConfig (), 
"mainsoft.use.portlet.namespace");
+                                               if (usePortletNamespace == null 
|| Boolean.Parse(usePortletNamespace))
+                                                       portletResponse = 
Context.ServletResponse as IPortletResponse;
+                                       }
                                        if (portletResponse != null)
                                                _PortletNamespace = 
portletResponse.getNamespace ();
                                        else if (_requestValueCollection != 
null && _requestValueCollection [PageNamespaceKey] != null)
@@ -110,7 +115,7 @@
                }
 
                public string CreateActionUrl (string url)
-               {
+               {
                        if (url.StartsWith (RenderPageMark, 
StringComparison.Ordinal) || url.StartsWith (ActionPageMark, 
StringComparison.Ordinal))
                                return url;
 

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

Reply via email to