@ SuppressWarnings ( "unchecked" ) public HttpServletRequest getChainedRequest ( ) throws IOException , ServletException { if ( super . containsError ( ) ) { throw super . getError ( ) ; } ChainedRequest req = new ChainedRequest ( this , _req ) ; //transfer any auto transfer headers Hashtable headers = getAutoTransferringHeaders ( ) ; Enumeration names = headers . keys ( ) ; while ( names . hasMoreElements ( ) ) { String name = ( String ) names . nextElement ( ) ; String value = ( String ) headers . get ( name ) ; req . setHeader ( name , value ) ; } //get headers from response and add to request Iterable < String > headerNames = getHeaderNames ( ) ; for ( String name : headerNames ) { String value = ( String ) getHeader ( name ) ; req . setHeader ( name , value ) ; } return req ; }
Returns a chained request that contains the data that was written to this response .