public boolean handleRequest ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { boolean handled = false ; // Internally UIResults.forward(), don't handle here if ( request . getAttribute ( UIResults . FERRET_NAME ) != null ) { return false ; } if ( globalPreRequestHandler != null ) { handled = globalPreRequestHandler . handleRequest ( request , response ) ; } if ( handled == false ) { RequestHandlerContext handlerContext = mapRequest ( request ) ; if ( handlerContext != null ) { RequestHandler requestHandler = handlerContext . getRequestHandler ( ) ; // need to add trailing "/" iff prefix is not "/": String pathPrefix = handlerContext . getPathPrefix ( ) ; if ( ! pathPrefix . equals ( "/" ) ) { pathPrefix += "/" ; } request . setAttribute ( REQUEST_CONTEXT_PREFIX , pathPrefix ) ; handled = requestHandler . handleRequest ( request , response ) ; } } if ( handled == false ) { if ( globalPostRequestHandler != null ) { handled = globalPostRequestHandler . handleRequest ( request , response ) ; } } return handled ; }
Map the incoming request to the appropriate RequestHandler including the PRE and POST RequestHandlers if configured .