commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trevor Miller" <>
Subject [httpclient]
Date Wed, 09 Aug 2006 09:13:45 GMT
Hi All,

I'm using HttpClient to download a simple XML document from a jsp
page, I want to be able to show a progress bar if it takes a long

In order to test this, i write a simple JSP with some calls to
Thread.sleep to simulate network latency and used the following code:

        HttpClient client = new HttpClient();
        HttpMethod method = new
        try {
            client.executeMethod (method);
            System.out.println ("Connected, reading response.");
            InputStream in = new BufferedInputStream(
                          new ProgressMonitorInputStream(
                                  method.getResponseBodyAsStream ()));
        } catch (IOException ex) {

Needless to say, this does not work since by the time
method.getResponseBodyAsStream () is called, the data has already been

Is there a way to do this?

Trevor Miller

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message