PlayFramework 1.x routes with classic query delimiters

106 Views Asked by At

In my routes:

GET /rest/trafficstats?{usr}&{pwd}        Controller.trafficstats

In my controllers:

 public static void trafficstats(String usr, String pwd) { ..

Does not work if I go by this ur:

http://localhost:9000/rest/trafficstats?usr=usr2&pwd=pwd

returns: 404

Why?

The deal is with the second param (pwd).. I should not use "&"?

1

There are 1 best solutions below

0
On BEST ANSWER

You need to use the url template without parameters at all, like:

GET /rest/trafficstats.

So when you do /rest/trafficstats?usr=usr&pwd=pass play will automatically bind your arguments