Query string http param in play framework 1.2.5

279 Views Asked by At

i need to add a route for following syntax

/bidding/12345?access_token=ACCESS_TOKEN

in my routes file i add like this

GET /bidding/{id}          Application.bidding

i try to send request with query param /bidding/12345?access_token=ACCESS_TOKEN like above but play response is 404 (not found), i was using play framework 1.2.5

thanks for any response to my question, and sorry for my bad English

2

There are 2 best solutions below

0
On BEST ANSWER

The URL you are trying to access is not represented correctly in the routes file.

If you would like to access the URL:

/bidding/12345?access_token=ACCESS_TOKEN

The routes file entry will need to be changed to the following:

GET /bidding          Application.bidding

Play will use its magic to route that GET request to the following method in the Application controller:

public static void bidding(String access_token)
0
On

Your route configuration seems ok : are you sure you have a valid public static method bidding in your Application class ? Could you post the source of this method ?