public static ServletResponse unwrapResponseKeepGoing(ServletResponse res, Class className)
	{
		ServletResponse r = res;
		ServletResponse deepestResponse=null;
		while (r!=null)
		{
			if (className.isInstance(r)){
				deepestResponse=r;
			}
			if (r instanceof ServletResponseWrapper)
			{
			    r = ((ServletResponseWrapper) r).getResponse();
			}
			else if (r instanceof HttpServletResponseProxy)
			{
			    r = ((HttpServletResponseProxy)r).getResponse();
			}
			else if (r instanceof IServletResponseWrapper)
			{
				r = ((IServletResponseWrapper)r).getWrappedResponse();
			}
			else{
				return deepestResponse;
			}
			
			
		}
		return deepestResponse;
		
	}
public static ServletResponse unwrapResponseKeepGoing ( ServletResponse res , Class className ) { ServletResponse r = res ; ServletResponse deepestResponse = null ; while ( r != null ) { if ( className . isInstance ( r ) ) { deepestResponse = r ; } if ( r instanceof ServletResponseWrapper ) { r = ( ( ServletResponseWrapper ) r ) . getResponse ( ) ; } else if ( r instanceof HttpServletResponseProxy ) { r = ( ( HttpServletResponseProxy ) r ) . getResponse ( ) ; } else if ( r instanceof IServletResponseWrapper ) { r = ( ( IServletResponseWrapper ) r ) . getWrappedResponse ( ) ; } else { return deepestResponse ; } } return deepestResponse ; }
@param req
@return