public static ScopedRequest unwrapRequest ( ServletRequest request ) { // Unwrap the multipart request, if there is one. if ( request instanceof MultipartRequestWrapper ) { request = ( ( MultipartRequestWrapper ) request ) . getRequest ( ) ; } while ( request instanceof ServletRequestWrapper ) { if ( request instanceof ScopedRequest ) { return ( ScopedRequest ) request ; } else { request = ( ( ServletRequestWrapper ) request ) . getRequest ( ) ; } } return null ; }
Unwraps the contained ScopedRequest from the given ServletRequest which may be a ServletRequestWrapper .