code: public static ScopedResponse unwrapResponse( ServletResponse response )
      {
          while ( response instanceof ServletResponseWrapper )
           {
               if ( response instanceof ScopedResponse )
               {
                   return ( ScopedResponse ) response;
               }
               else
               {
                   response = ( ( ServletResponseWrapper ) response ).getResponse();
               }
           }
          
           return null;
       }
docs: Unwraps the contained ScopedResponseImpl from the given ServletResponse, which may be a
  ServletResponseWrapper.
  
  @param response the ScopedResponse, or a wrapper (ServletResponseWrapper) around it.
  @return the unwrapped ScopedResponseImpl.
  
  @exclude