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
Post a Comment