-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routes 'Assign static args' only work for first argument #998
Comments
@chinyeelee could you show the declaration of the method allResidences in the controller? |
@xael-fry Thanks Alexandre, our actual api is rather complicated and beyond the scope of the question, so I simplified the usage. Tested with the following:
Using:
Only the first item, that is adType will have the value 'sale'. type remains as null. |
@chinyeelee, just removed the space after ',' should make it work. I will add a fix to avoid this problem for 1.4.x |
…static args in routes
[#998] fix(router): allow to have space when defining static args in routes
…n routes # Conflicts: # framework/src/play/mvc/Router.java
Thank you for the help! @xael-fry |
Hi Play Framework team,
I am using play 1.2.7.2 (also tested in 1.4.2 which still contains the problem)
I want to assign a specific route to an existing Controller as described in the section: "Assign static args"
https://www.playframework.com/documentation/1.4.x/routes
GET /properties/condos-for-sale App.allResidences(adType:'sale', type:'condo')
However, only the first parameter is sent to the controller, the controller only receives adType with the String value of 'sale', and the type remains as null. If I remove the first argument or swap the position of the two arguments then type will be assigned to 'condo'. But the second argument will remain as null.
Is there a work around or a fix for this? Integrating this back to 1.2 will be great so that our existing app will be less likely to break from the upgrade.
Thank you!
Chin
The text was updated successfully, but these errors were encountered: