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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -