Author: scottbw
Date: Wed Mar 28 12:48:40 2012
New Revision: 1306293
URL: http://svn.apache.org/viewvc?rev=1306293&view=rev
Log:
Allow some leniency over whether the correct parameter name is "id_key" or
"idkey" in widgetinstance-related API requests
Modified:
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
Modified:
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java?rev=1306293&r1=1306292&r2=1306293&view=diff
==============================================================================
---
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
(original)
+++
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
Wed Mar 28 12:48:40 2012
@@ -419,7 +419,16 @@ public class WidgetInstancesController e
IPersistenceManager persistenceManager =
PersistenceManagerFactory.getPersistenceManager();
// Try using the id_key parameter
- String id_key = request.getParameter("idkey"); //$NON-NLS-1$
+ String id_key = request.getParameter("id_key"); //$NON-NLS-1$
+
+ //
+ // If there is no "id_key", check for "idkey" without the underscore as
+ // a fallback
+ //
+ if (id_key == null){
+ id_key = request.getParameter("idkey");
+ }
+
if (id_key != null & id_key != ""){
instance =
persistenceManager.findWidgetInstanceByIdKey(id_key);
return instance;