Note that there are some explanatory texts on larger screens.

plurals
  1. POhow do I get a List of Key values in ParameterMap (Spring)
    text
    copied!<p>I hava a ParameterMap set that has completely different parameters in different scenarios</p> <p>What i need is a String Array of "keys" in the ParameterMap</p> <p>The closest i have got is using reportParams.toString(); Here is what i used to get the folowing output</p> <pre><code>ParameterMap reportParams = context.getRequestParameters(); System.out.println(reportParams.toString()); </code></pre> <p>// The Output</p> <p>map['username' -> 'user', 'decorate' -> 'no', 'decorator' -> 'empty', 'ajax' -> 'true', '_eventId' -> 'refreshReport', 'VEFactorSelection'-> '1', 'campusAndFaculty' -> array['111', '113', '115', '118', '112', '114', '116', '117', '21907', '21908', '99040', '99010', '99100', '99230', '99240'], '_flowExecutionKey' -> 'e4s1', 'reportLanguage' -> '3', 'date' -> '2013/06/20', 'nameType2' -> '1', 'confirm' -> 'true']</p> <p>So what i want as end result is</p> <p>username, decorate, decorator, ajax, _ecentId, VEFactorSelection, campusAndFaculty, _flowExecutionKey, reportLanguage, date, nameType2, confirm</p> <p>I have Tried this</p> <pre><code>ParameterMap reportParams = context.getRequestParameters(); final List&lt;String&gt; names = new ArrayList&lt;String&gt;(); for (final Object o: reportParams.asMap().keySet()) names.add((String) o); final String[] array = names.toArray(new String[names.size()]); System.out.println(array[0]); // this part is just to see if i get output </code></pre> <p>End result of above code:</p> <p>=================================== org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'org.hibernate.mapping.Map' for property 'readOnlyConfiguredExporters'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.util.LinkedHashMap] to required type [org.hibernate.mapping.Map] for property 'readOnlyConfiguredExporters': no matching editors or conversion strategy found</p> <p>=============================== Some extra's</p> <p>Here is the API for "ParameterMap" <a href="http://static.springsource.org/spring-webflow/docs/1.0.x/api/org/springframework/webflow/core/collection/ParameterMap.html" rel="nofollow">http://static.springsource.org/spring-webflow/docs/1.0.x/api/org/springframework/webflow/core/collection/ParameterMap.html</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload