play框架是否支持像rails这样的嵌套路由?

Ahm*_*ani 3 routes url-routing playframework playframework-2.0

Rails使得可以映射逻辑上其他资源的子资源的资源在URL中

/magazines/:magazine_id/ads/:id show    display a specific ad belonging to a specific magazine
Run Code Online (Sandbox Code Playgroud)

是否可以在Play中执行此操作?

bie*_*ior 7

Play不关心参数是否代表某种关系,它是你控制器的工作.

当然可以这样做:

GET /some/:parent/:child   controllers.Application.getRelated(parent: Long, child: Long)
Run Code Online (Sandbox Code Playgroud)

在控制器中:

public static Result getRelated(Long parent, Long child) {
    return ok(SomeFinder(parent,child));
}
Run Code Online (Sandbox Code Playgroud)