FELIX-4187 : Configuration Plugin does a POST to get configuration details
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1534095 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigManager.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigManager.java
index b657441..c818b87 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigManager.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigManager.java
@@ -22,6 +22,7 @@
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
+
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -213,8 +214,13 @@
protected void doGet( HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException
{
- // let's check for a JSON request
+ // check for "post" requests from previous versions
+ if ( "true".equals(request.getParameter("post")) ) {
+ this.doPost(request, response);
+ return;
+ }
final String info = request.getPathInfo();
+ // let's check for a JSON request
if ( info.endsWith( ".json" ) ) //$NON-NLS-1$
{
response.setContentType( "application/json" ); //$NON-NLS-1$
diff --git a/webconsole/src/main/resources/res/ui/config.js b/webconsole/src/main/resources/res/ui/config.js
index 581fb5f..9f893a0 100644
--- a/webconsole/src/main/resources/res/ui/config.js
+++ b/webconsole/src/main/resources/res/ui/config.js
@@ -34,12 +34,12 @@
function configure(pid, create) {
var uri = pluginRoot + '/' + pid;
// we have to add a cache killer for IE8
- var postUri = uri + '?';
+ var postUri = uri + '?post=true&';
if ( create ) {
postUri += param.create + '=1&';
}
postUri = postUri + 'ts='+new Date().getMilliseconds();
- $.post(postUri, null, displayConfigForm, 'json');
+ $.get(postUri, null, displayConfigForm, 'json');
}
function displayConfigForm(obj) {