/** * Sets the preferred buffer size for the body of the response. The servlet container * will use a buffer at least as large as the size requested. The actual buffer size * used can be found using getBufferSize. **/ public void setBufferSize( int size ) { if (getContents().length != 0) throw new IllegalStateException( "May not set buffer size after data is written" ); }
/** * Sets the preferred buffer size for the body of the response. The servlet container * will use a buffer at least as large as the size requested. The actual buffer size * used can be found using getBufferSize. **/ public void setBufferSize( int size ) { if (getContents().length != 0) throw new IllegalStateException( "May not set buffer size after data is written" ); }
/** * Sets the preferred buffer size for the body of the response. The servlet container * will use a buffer at least as large as the size requested. The actual buffer size * used can be found using getBufferSize. **/ public void setBufferSize( int size ) { if (getContents().length != 0) throw new IllegalStateException( "May not set buffer size after data is written" ); }
/** * Constructs a response object from a servlet response. * @param frame the target frame on which the response will be displayed * @param url the url from which the response was received * @param response the response populated by the servlet **/ ServletUnitWebResponse( ServletUnitClient client, FrameSelector frame, URL url, HttpServletResponse response, boolean throwExceptionOnError ) throws IOException { super( client, frame, url ); _response = (ServletUnitHttpResponse) response; /** make sure that any IO exception for HTML received page happens here, not later. **/ if (getResponseCode() < HttpURLConnection.HTTP_BAD_REQUEST || !throwExceptionOnError) { defineRawInputStream( new ByteArrayInputStream( _response.getContents() ) ); if (getContentType().startsWith( "text" )) loadResponseText(); } }
/** * Constructs a response object from a servlet response. * @param frame the target frame on which the response will be displayed * @param url the url from which the response was received * @param response the response populated by the servlet **/ ServletUnitWebResponse( ServletUnitClient client, FrameSelector frame, URL url, HttpServletResponse response, boolean throwExceptionOnError ) throws IOException { super( client, frame, url ); _response = (ServletUnitHttpResponse) response; /** make sure that any IO exception for HTML received page happens here, not later. **/ if (getResponseCode() < HttpURLConnection.HTTP_BAD_REQUEST || !throwExceptionOnError) { defineRawInputStream( new ByteArrayInputStream( _response.getContents() ) ); if (getContentType().startsWith( "text" )) loadResponseText(); } }
/** * Constructs a response object from a servlet response. * @param frame the target frame on which the response will be displayed * @param url the url from which the response was received * @param response the response populated by the servlet **/ ServletUnitWebResponse( ServletUnitClient client, FrameSelector frame, URL url, HttpServletResponse response, boolean throwExceptionOnError ) throws IOException { super( client, frame, url ); _response = (ServletUnitHttpResponse) response; /** make sure that any IO exception for HTML received page happens here, not later. **/ if (getResponseCode() < HttpURLConnection.HTTP_BAD_REQUEST || !throwExceptionOnError) { defineRawInputStream( new ByteArrayInputStream( _response.getContents() ) ); if (getContentType().startsWith( "text" )) loadResponseText(); } }