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

  1. rename , move /public/web/static.html /app/views/staticfile.scala.html
  2. change route

    get  /route/*path    controllers.application.staticfile(path: string)
  3. add method /app/controllers/application.java

    public static result staticfile(string path) {     return ok(views.html.staticfile.render()); }

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -