Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to <a href="http://www.playframework.org/documentation/1.2.4/controllers" rel="nofollow">http://www.playframework.org/documentation/1.2.4/controllers</a>, when a Play action handles a Map parameter, it expects a specific format for the query parameters:</p> <blockquote> <p>Play also handles the special case of binding a Map like this:</p> <blockquote> <p>public static void show(Map client) { … }</p> </blockquote> <p>A query string like the following:</p> <blockquote> <p>?client.name=John&amp;client.phone=111-1111&amp;client.phone=222-2222</p> </blockquote> <p>would bind the client variable to a map with two elements. The first element with key name and value John, and the second with key phone and value 111-1111, 222-2222.</p> </blockquote> <p>In other words, you have to use specially formatted, named query parameters. What you want is instead to pass along all the query parameters.</p> <p>Here's a working example. It seems verbose, but it works. Try hitting /application/externalRouteHit?color=red&amp;size=XS.</p> <pre><code>public class Application extends Controller { public static void externalRouteHit() { Map&lt;String, Object&gt; myParams = new HashMap&lt;String, Object&gt;(); for (String key : params.allSimple().keySet()) { if (!key.equals("body")) { myParams.put(key, params.allSimple().get(key)); } } redirect(Router.reverse("Application.redirectedRoute", myParams).url); } public static void redirectedRoute() { renderText("color = " + params.get("color") + ", size = " + params.get("size")); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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