java - Play framework routes -


i want catch unkown operations.

my routes file looks this:

get     /                       controllers.maincontroller.index() #all other routes  #finally     /[^/]+/                 controllers.maincontroller.fault() 

the final definition @ bottom on list because of priority given above operations, otherwise requests true /[^/]+/ condition.

the problem goes default catch page saying 'action not found'

how can catch routes?

i believe

get  /*route controllers.maincontroller.fault() 

would work better. route capture path received, can pass argument fault method.

but, suggest alternative: can implement globalsettings object override method

def onhandlernotfound(request: requestheader): future[simpleresult] 

this method called each time request not possible find proper handler. can find more information here: http://www.playframework.com/documentation/2.2.x/scalaglobal


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -