The get () method is defined as (similar to POST, etc.):
def get(transformers : org.scalatra.RouteTransformer*)(action : => scala.Any) : org.scalatra.Route
Depending on what you mean by internal redirection, I assume that you just want to perform a different route action. You have several options for what you can do. This seems to work for me:
val canonicalEndpoint = get("/first/route") { //do things in here }
Then you could do the following:
get("/second/route")( canonicalEndpoint.action )
And I think you will get the desired answer.
I like to keep the entire get () route response as you can also use it with the scalatra url () function in routing.
source share