private Route matchStandard ( String uri , ControllerPath controllerPathObject , AppController controller , HttpMethod method ) { String controllerPath = ( controllerPathObject . getControllerPackage ( ) != null ? "/" + controllerPathObject . getControllerPackage ( ) . replace ( "." , "/" ) : "" ) + "/" + controllerPathObject . getControllerName ( ) ; String theUri = uri . endsWith ( "/" ) ? uri . substring ( 0 , uri . length ( ) - 1 ) : uri ; //ANY /package_suffix/controller if ( controllerPath . length ( ) == theUri . length ( ) ) { return new Route ( controller , "index" , method ) ; } String [ ] parts ; try { String tail = theUri . substring ( controllerPath . length ( ) + 1 ) ; parts = split ( tail , "/" ) ; } catch ( Exception e ) { throw new RouteException ( "Failed to parse route from: '" + uri + "'" , e ) ; } //ANY /package_suffix/controller/action if ( parts . length == 1 ) { return new Route ( controller , parts [ 0 ] , method ) ; } //ANY /package_suffix/controller/action/id/ if ( parts . length == 2 ) { return new Route ( controller , parts [ 0 ] , parts [ 1 ] , method ) ; } LOGGER . warn ( "Failed to find action for request: " + uri ) ; return null ; }
Will match a standard non - restful route .