1
votes

How can I call a controller action (route) myself when I have the path and the parameters in variables?

I found this in the documentation (http://www.playframework.com/documentation/2.1.x/JavaFunctionalTest):

import play.test.Helpers;
...
Result result = Helpers.routeAndCall(Helpers.fakeRequest(Helpers.GET, "/xx/Kiki"));

But the play.test package is not available in production mode. I'm using the latest play 2.1.2.

1
Kris, be serious... you didn't even specify Play's version, what did you try... Your question for us is I have a Car how can I do Something? - biesior
Thanks, I added more information, tell me if it's not clear yet. - Kris Pypen
Why not call it like any other method? e.g. return controllerMethod(param1, param2, ...) - 2manyprojects
I have the path as a string and the request parameters in a map, I don't know the controller method - Kris Pypen

1 Answers

0
votes

I now use the WS.url("http://my.local.domain/....") for normal requests and the eclipse jetty httpclient for the comet requests.