@ Nullable public Servlet getServletOfPath ( @ Nullable final String sPath ) { final ICommonsList < ServletItem > aMatchingItems = new CommonsArrayList <> ( ) ; if ( StringHelper . hasText ( sPath ) ) m_aServlets . findAll ( aItem -> aItem . matchesPath ( sPath ) , aMatchingItems :: add ) ; final int nMatchingItems = aMatchingItems . size ( ) ; if ( nMatchingItems == 0 ) return null ; if ( nMatchingItems > 1 ) if ( LOGGER . isWarnEnabled ( ) ) LOGGER . warn ( "Found more than 1 servlet matching path '" + sPath + "' - using first one: " + aMatchingItems ) ; return aMatchingItems . getFirst ( ) . getServlet ( ) ; }
Find the servlet matching the specified path .