override def onRouteRequest(req: RequestHeader): Option[Handler] = {
if (req.path == "/myUrl") {
val v1 = req.queryString("p1")
...
val v23 = req.queryString("p23")
Some(myController(v1, .., v23))
} else {
super.onRouteRequest(req)
}
}
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
But I didn't want to open an issue before asking here what do you guys think.
Besides, given that scala has already lifted this limitation, why don't do the same for controllers?
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
we have considered extracting the parameters directly from the request, but we abandoned that path because of some conflicts with the framework we use to autogenerate our documentation
Hi James,
We're using Scala. I am aware of that, and we have considered extracting the paramaters directly from the request, but we abandoned that path because of some conflicts with the framework we use to autogenerate our documentation (and of course we could change it, but that would imply a major change for us, and we need a faster solution).
Of course I understand our case is a *super* particular one, but I wanted to put this here for your consideration, given maybe someone finds the change useful...
Hi Clara,
That looks quite straight forward, great to see the simplicity.Performance wise, it introduces a new instanceof check for each parameter, since the type information is lost and then regained in the extractor. I don't think that's anything to worry about, our performance tests should pick up any regressions here anyway. If it were a problem, we could keep the callN methods for, say, up to 6 parameters, and switch to using a list for anything over that. But I don't think it's a big deal.I'd love to include this in Play, the only issue is you've made the change against Play 2.3, and Play 2.4 has completely refactored the routes compiler (note, that doesn't necessarily mean that it's any less convoluted..... well hopefully it is, but I think it's a problem that has to be gradually chipped away at).