I'm trying to redirect to a controller method which is taking Long and String as argument by using the reverse controller. I use version 2.4 of the play framework.
I've defined this route in the routes file:
GET /games/play/:id controllers.Games.renderGame(id: Long, feedback: String = "")
To call this route, I'm using in a other method redirect():
return redirect(controllers.routes.Games.renderGame(gameId, "test"));
And here is my renderGame() method:
public Result renderGame(Long id, String feedback) {
//do something
return ok(...);
}
In my opinion this actually should work but play gives me a error:
error: method renderGame in class ReverseGames cannot be applied to given types;
IntelliJ is trying to do it better: Error picture
If I define the method just with Long as parameter it's working fine but when a add the String I get the error again.
Any idea what's wrong here?
Related to this Question, it actually should work: Play Framework: Redirect to controller method with arguments