Java Play 2.3 Match any route which starts with certain string -
is there way match part route. need route definition should match following routes
/route
/route/part1 ...
the part after "/route" dynamic , variable. every route starts "/route" should matched.
my try:
get /route/<[a-z]+> controllers.assets.at(path="/public/web", file="static.html")
error: action not found request 'get /route/home'
get /route/*file controllers.assets.at(path="/public/web", file="static.html")
error: not allowed specify fixed or default value parameter: 'file' extracted path
- rename , move /public/web/static.html /app/views/staticfile.scala.html
change route
get /route/*path controllers.application.staticfile(path: string)
add method /app/controllers/application.java
public static result staticfile(string path) { return ok(views.html.staticfile.render()); }
Comments
Post a Comment