Fixed FELIX-3817 : Form parameters might clash with configuration parameters
https://issues.apache.org/jira/browse/FELIX-3817

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1633064 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
index 9da0f08..a52d684 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java
@@ -186,6 +186,12 @@
             while ( propTokens.hasMoreTokens() )
             {
                 String propName = propTokens.nextToken();
+                String paramName = "action".equals(propName) //$NON-NLS-1$
+                    || ConfigManager.ACTION_DELETE.equals(propName)
+                    || ConfigManager.ACTION_APPLY.equals(propName)
+                    || ConfigManager.PROPERTY_LIST.equals(propName) 
+                    ? '$' + propName : propName;
+                
                 PropertyDescriptor ad = (PropertyDescriptor) adMap.get( propName );
 
                 // try to derive from current value
@@ -199,7 +205,7 @@
                 if ( ad == null
                     || ( ad.getCardinality() == 0 && ( attributeType == AttributeDefinition.STRING || attributeType == MetaTypeServiceSupport.ATTRIBUTE_TYPE_PASSWORD ) ) )
                 {
-                    String prop = request.getParameter( propName );
+                    String prop = request.getParameter( paramName );
                     if ( prop != null
                         && ( attributeType != MetaTypeSupport.ATTRIBUTE_TYPE_PASSWORD || !MetaTypeSupport.PASSWORD_PLACEHOLDER_VALUE.equals( prop ) ) )
                     {
@@ -209,7 +215,7 @@
                 else if ( ad.getCardinality() == 0 )
                 {
                     // scalar of non-string
-                    String prop = request.getParameter( propName );
+                    String prop = request.getParameter( paramName );
                     if ( prop != null )
                     {
                         try
@@ -227,7 +233,7 @@
                     // array or vector of any type
                     Vector vec = new Vector();
 
-                    String[] properties = request.getParameterValues( propName );
+                    String[] properties = request.getParameterValues( paramName );
                     if ( properties != null )
                     {
                         if ( attributeType == MetaTypeSupport.ATTRIBUTE_TYPE_PASSWORD )
diff --git a/webconsole/src/main/resources/res/ui/config.js b/webconsole/src/main/resources/res/ui/config.js
index 1ecf0b8..02ca0ff 100644
--- a/webconsole/src/main/resources/res/ui/config.js
+++ b/webconsole/src/main/resources/res/ui/config.js
@@ -151,7 +151,8 @@
         if (attr.value != undefined)
         {
             // check is required to also handle empty strings, 0 and false
-            tdEl.appendChild( createInput( prop, attr.value, attr.type, '99%' ) );
+            var inputName = (prop == "action" || prop == "propertylist" || prop == "apply" || prop == "delete") ? '$' + prop : prop;
+            tdEl.appendChild( createInput( inputName, attr.value, attr.type, '99%' ) );
             tdEl.appendChild( createElement( "br" ) );
         }
         else if (typeof(attr.type) == 'object')