private static HttpServletRequest getWrappedServletRequestObject ( HttpServletRequest sr ) { if ( sr instanceof HttpServletRequestWrapper ) { HttpServletRequestWrapper w = ( HttpServletRequestWrapper ) sr ; // make sure we drill all the way down to an // SRTServletRequest...there // may be multiple proxied objects sr = ( HttpServletRequest ) w . getRequest ( ) ; while ( sr instanceof HttpServletRequestWrapper ) sr = ( HttpServletRequest ) ( ( HttpServletRequestWrapper ) sr ) . getRequest ( ) ; } return sr ; }
Drill down through any possible HttpServletRequestWrapper objects .