Below is my code for handling redirections and the wired log. Thanx for your help.
--mike
private WebClient() {
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
"true");
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire.header",
"debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
"debug");
CookiePolicy.registerCookieSpec(CookiePolicy.BROWSER_COMPATIBILITY,
CookieSpecBase.class);
CookieSpecBase csb =
(CookieSpecBase)CookiePolicy.getCookieSpec(CookiePolicy.BROWSER_COMPATIBILITY);
System.out.println("domainMatch? " +
csb.domainMatch("cxtst.xrce.xerox.com", ".cxtst.xrce.xerox.com"));
_client = new HttpClient(new
MultiThreadedHttpConnectionManager());
_client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
_parser = new DOMParser();
try {
_parser.setProperty("http://cyberneko.org/html/properties/names/elems",
"lower");
} catch (SAXNotRecognizedException e) {
e.printStackTrace();
} catch (SAXNotSupportedException e) {
e.printStackTrace();
}
}
/ /**/
/ * Execute a http method/
/ * /
/ * @param method The method/
/ * @return the last http method executed (after following
redirects)/
/ *//
/ public HttpMethod executeMethod(HttpMethod method) throws
URIException {/
/ method.setRequestHeader("User-Agent", "Mozilla/4.0
(compatible; MSIE 6.0b; Windows 98)");/
/ /
/ int statusCode = -1;/
/ int attempt = 0;/
/ // We will retry up to 3 times./
/ while ((statusCode == -1) && (attempt < 3)) {/
/ try {/
/ // execute the method./
/ System.out.println("before client.executeMethod");/
/ statusCode = _client.executeMethod(method);/
/ System.out.println("afterr client.executeMethod");/
/ } catch (IOException e) {/
/ System.out.println("Failed to download file.");/
/ e.printStackTrace();/
/ throw new RuntimeException("Failed to download
file.");/
/ }/
/ }/
/ /
/ // Check that we didn't run out of retries./
/ if (statusCode == -1) {/
/ System.out.println("Failed to recover from exception.");/
/ throw new RuntimeException("Error when reading " +
method.getPath());/
/ }/
/ /
/ if (statusCode >= 400) {/
/ System.out.println("Page not found (error " +
statusCode + ")");/
/ throw new RuntimeException("Error when reading " +
method.getPath());/
/ }/
/ /
/ // Tests for redirects/
/ if ((statusCode >= 300) && (statusCode < 400)) {/
/ Header locationHeader =
method.getResponseHeader("location");/
/ /
/ if (locationHeader == null) {/
/ locationHeader = method.getResponseHeader("Location");/
/ }/
/ /
/ if (locationHeader != null) {/
/ String redirectLocation = locationHeader.getValue();/
/ method.releaseConnection(); /
/ /
/ URI uri = new URI(redirectLocation, false);/
/ if (!uri.isAbsoluteURI()) {/
/ uri = method.getURI();/
/ if (!redirectLocation.startsWith("/")) {/
/ redirectLocation = uri.getCurrentHierPath()
+ "/" + redirectLocation;/
/ }/
/ uri.setPath(redirectLocation);/
/ redirectLocation = uri.getURI();/
/ }/
/ System.out.println("redirected to " +
redirectLocation);/
/ /
/ // Get all the cookies/
/ HttpMethod redirectMethod = new
GetMethod(redirectLocation);/
/ /
/ executeMethod(redirectMethod);/
/ /
/ return redirectMethod;/
/ } else {/
/ // The response is invalid and did not provide the
new location for/
/ // the resource. Report an error or possibly
handle the response/
/ // like a 404 Not Found error./
/ System.out.println("Page not found");/
/ throw new RuntimeException("Error when reading " +
method);/
/ }/
/ }/
/ /
/ return method;/
/ }/domainMatch? true
2005/02/09 18:54:58:847 CET [DEBUG] HttpClient - -Java version: 1.5.0-beta
2005/02/09 18:54:58:848 CET [DEBUG] HttpClient - -Java vendor: Sun Microsystems Inc.
2005/02/09 18:54:58:848 CET [DEBUG] HttpClient - -Java class path: /home/niemaz/maven-1.0.2//lib/forehead-1.0-beta-5.jar
2005/02/09 18:54:58:849 CET [DEBUG] HttpClient - -Operating system name: Linux
2005/02/09 18:54:58:849 CET [DEBUG] HttpClient - -Operating system architecture: i386
2005/02/09 18:54:58:849 CET [DEBUG] HttpClient - -Operating system version: 2.6.10-1.741_FC3smp
2005/02/09 18:54:58:984 CET [DEBUG] HttpClient - -SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)
2005/02/09 18:54:58:984 CET [DEBUG] HttpClient - -SunRsaSign 1.5: Sun RSA signature provider
2005/02/09 18:54:58:984 CET [DEBUG] HttpClient - -SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
2005/02/09 18:54:58:984 CET [DEBUG] HttpClient - -SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)
2005/02/09 18:54:58:985 CET [DEBUG] HttpClient - -SunJGSS 1.0: Sun (Kerberos v5)
2005/02/09 18:54:58:985 CET [DEBUG] HttpClient - -SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)
2005/02/09 18:54:59:009 CET [DEBUG] DefaultHttpParams - -Set parameter http.useragent = Jakarta Commons-HttpClient/3.0-rc1
2005/02/09 18:54:59:012 CET [DEBUG] DefaultHttpParams - -Set parameter http.protocol.version = HTTP/1.1
2005/02/09 18:54:59:014 CET [DEBUG] DefaultHttpParams - -Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager
2005/02/09 18:54:59:014 CET [DEBUG] DefaultHttpParams - -Set parameter http.protocol.cookie-policy = rfc2109
2005/02/09 18:54:59:014 CET [DEBUG] DefaultHttpParams - -Set parameter http.protocol.element-charset = US-ASCII
2005/02/09 18:54:59:017 CET [DEBUG] DefaultHttpParams - -Set parameter http.protocol.content-charset = ISO-8859-1
2005/02/09 18:54:59:020 CET [DEBUG] DefaultHttpParams - -Set parameter http.method.retry-handler = [EMAIL PROTECTED]
2005/02/09 18:54:59:020 CET [DEBUG] DefaultHttpParams - -Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
2005/02/09 18:54:59:039 CET [DEBUG] DefaultHttpParams - -Set parameter http.protocol.cookie-policy = compatibility
Using proxy cornillon:8000
2005/02/09 18:54:59:224 CET [DEBUG] MultiThreadedHttpConnectionManager - -HttpConnectionManager.getConnection: config = HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000], timeout = 0
2005/02/09 18:54:59:226 CET [DEBUG] MultiThreadedHttpConnectionManager - -Allocating new connection, hostConfig=HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000]
2005/02/09 18:54:59:235 CET [DEBUG] HttpConnection - -Open connection to cornillon:8000
2005/02/09 18:54:59:281 CET [DEBUG] header - ->> "GET http://cxtst.xrce.xerox.com/account/login.php HTTP/1.1[\r][\n]"
2005/02/09 18:54:59:282 CET [DEBUG] HttpMethodBase - -Adding Host request header
2005/02/09 18:54:59:283 CET [DEBUG] header - ->> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)[\r][\n]"
2005/02/09 18:54:59:283 CET [DEBUG] header - ->> "Host: cxtst.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:283 CET [DEBUG] header - ->> "Proxy-Connection: Keep-Alive[\r][\n]"
2005/02/09 18:54:59:284 CET [DEBUG] header - ->> "[\r][\n]"
2005/02/09 18:54:59:328 CET [DEBUG] header - -<< "HTTP/1.0 200 OK[\r][\n]"
2005/02/09 18:54:59:331 CET [DEBUG] header - -<< "Date: Wed, 09 Feb 2005 17:43:44 GMT[\r][\n]"
2005/02/09 18:54:59:331 CET [DEBUG] header - -<< "Server: Apache/2.0.48 (RHEL 3)[\r][\n]"
2005/02/09 18:54:59:332 CET [DEBUG] header - -<< "Accept-Ranges: bytes[\r][\n]"
2005/02/09 18:54:59:332 CET [DEBUG] header - -<< "X-Powered-By: PHP/4.3.2[\r][\n]"
2005/02/09 18:54:59:332 CET [DEBUG] header - -<< "Expires: Wed, 11 Nov 1998 11:11:11 GMT[\r][\n]"
2005/02/09 18:54:59:332 CET [DEBUG] header - -<< "Cache-Control: must-revalidate[\r][\n]"
2005/02/09 18:54:59:333 CET [DEBUG] header - -<< "Set-Cookie: SF_THEME=000000codex; expires=Thu, 09-Feb-2006 17:43:44 GMT; path=/[\r][\n]"
2005/02/09 18:54:59:333 CET [DEBUG] header - -<< "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:43:44 GMT; path=/[\r][\n]"2005/02/09 18:54:59:333 CET [DEBUG] header - -<< "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
2005/02/09 18:54:59:333 CET [DEBUG] header - -<< "X-Cache: MISS from www-cache.grenoble.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:334 CET [DEBUG] header - -<< "Proxy-Connection: close[\r][\n]"
2005/02/09 18:54:59:394 CET [DEBUG] HttpMethodBase - -Cookie accepted: "SF_THEME=000000codex"
2005/02/09 18:54:59:396 CET [DEBUG] HttpMethodBase - -Cookie accepted: "SF_FONTSIZE=0000002"
2005/02/09 18:54:59:563 CET [DEBUG] HttpMethodBase - -Should close connection in response to directive: close
2005/02/09 18:54:59:563 CET [DEBUG] HttpConnection - -Releasing connection back to connection manager.
2005/02/09 18:54:59:564 CET [DEBUG] MultiThreadedHttpConnectionManager - -Freeing connection, hostConfig=HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000]
2005/02/09 18:54:59:564 CET [DEBUG] IdleConnectionHandler - -Adding connection at: 1107971699564
2005/02/09 18:54:59:564 CET [DEBUG] MultiThreadedHttpConnectionManager - -Notifying no-one, there are no waiting threads
2005/02/09 18:54:59:666 CET [DEBUG] MultiThreadedHttpConnectionManager - -HttpConnectionManager.getConnection: config = HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000], timeout = 0
2005/02/09 18:54:59:666 CET [DEBUG] MultiThreadedHttpConnectionManager - -Getting free connection, hostConfig=HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000]
2005/02/09 18:54:59:666 CET [DEBUG] HttpConnection - -Open connection to cornillon:8000
2005/02/09 18:54:59:667 CET [DEBUG] header - ->> "POST http://cxtst.xrce.xerox.com/account/login.php HTTP/1.1[\r][\n]"
2005/02/09 18:54:59:667 CET [DEBUG] HttpMethodBase - -Adding Host request header
2005/02/09 18:54:59:669 CET [DEBUG] HttpMethodBase - -Default charset used: ISO-8859-1
2005/02/09 18:54:59:671 CET [DEBUG] HttpMethodBase - -Default charset used: ISO-8859-1
2005/02/09 18:54:59:672 CET [DEBUG] header - ->> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)[\r][\n]"
2005/02/09 18:54:59:672 CET [DEBUG] header - ->> "Host: cxtst.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:672 CET [DEBUG] header - ->> "Cookie: SF_THEME=000000codex[\r][\n]"
2005/02/09 18:54:59:677 CET [DEBUG] header - ->> "Cookie: SF_FONTSIZE=0000002[\r][\n]"
2005/02/09 18:54:59:678 CET [DEBUG] header - ->> "Proxy-Connection: Keep-Alive[\r][\n]"
2005/02/09 18:54:59:678 CET [DEBUG] header - ->> "Content-Length: 50[\r][\n]"
2005/02/09 18:54:59:678 CET [DEBUG] header - ->> "Content-Type: application/x-www-form-urlencoded[\r][\n]"
2005/02/09 18:54:59:678 CET [DEBUG] header - ->> "[\r][\n]"
2005/02/09 18:54:59:679 CET [DEBUG] HttpMethodBase - -Default charset used: ISO-8859-1
2005/02/09 18:54:59:679 CET [DEBUG] EntityEnclosingMethod - -Request body sent
2005/02/09 18:54:59:739 CET [DEBUG] header - -<< "HTTP/1.0 302 Moved Temporarily[\r][\n]"
2005/02/09 18:54:59:741 CET [DEBUG] header - -<< "Date: Wed, 09 Feb 2005 17:43:44 GMT[\r][\n]"
2005/02/09 18:54:59:741 CET [DEBUG] header - -<< "Server: Apache/2.0.48 (RHEL 3)[\r][\n]"
2005/02/09 18:54:59:742 CET [DEBUG] header - -<< "Accept-Ranges: bytes[\r][\n]"
2005/02/09 18:54:59:742 CET [DEBUG] header - -<< "X-Powered-By: PHP/4.3.2[\r][\n]"
2005/02/09 18:54:59:743 CET [DEBUG] header - -<< "Expires: Wed, 11 Nov 1998 11:11:11 GMT[\r][\n]"
2005/02/09 18:54:59:743 CET [DEBUG] header - -<< "Cache-Control: must-revalidate[\r][\n]"
2005/02/09 18:54:59:743 CET [DEBUG] header - -<< "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:43:44 GMT; path=/[\r][\n]"2005/02/09 18:54:59:744 CET [DEBUG] header - -<< "Set-Cookie: session_hash=90555e7ba5dc7399a44a196e8165c978; path=/; domain=.cxtst.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:745 CET [DEBUG] header - -<< "Location: http://cxtst.xrce.xerox.com/my/[\r][\n]"
2005/02/09 18:54:59:745 CET [DEBUG] header - -<< "Content-Length: 0[\r][\n]"
2005/02/09 18:54:59:745 CET [DEBUG] header - -<< "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
2005/02/09 18:54:59:747 CET [DEBUG] header - -<< "X-Cache: MISS from www-cache.grenoble.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:747 CET [DEBUG] header - -<< "Proxy-Connection: keep-alive[\r][\n]"
2005/02/09 18:54:59:749 CET [DEBUG] HttpMethodBase - -Cookie accepted: "SF_FONTSIZE=0000002"
2005/02/09 18:54:59:749 CET [DEBUG] HttpMethodBase - -Cookie accepted: "session_hash=90555e7ba5dc7399a44a196e8165c978"
2005/02/09 18:54:59:750 CET [DEBUG] HttpMethodDirector - -Redirect required
2005/02/09 18:54:59:750 CET [INFO] HttpMethodDirector - -Redirect requested but followRedirects is disabled
2005/02/09 18:54:59:752 CET [DEBUG] HttpMethodBase - -Should NOT close connection in response to directive: keep-alive
2005/02/09 18:54:59:752 CET [DEBUG] HttpConnection - -Releasing connection back to connection manager.
2005/02/09 18:54:59:752 CET [DEBUG] MultiThreadedHttpConnectionManager - -Freeing connection, hostConfig=HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000]
2005/02/09 18:54:59:752 CET [DEBUG] IdleConnectionHandler - -Adding connection at: 1107971699752
2005/02/09 18:54:59:752 CET [DEBUG] MultiThreadedHttpConnectionManager - -Notifying no-one, there are no waiting threads
redirected to http://cxtst.xrce.xerox.com/my/
2005/02/09 18:54:59:754 CET [DEBUG] MultiThreadedHttpConnectionManager - -HttpConnectionManager.getConnection: config = HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000], timeout = 0
2005/02/09 18:54:59:755 CET [DEBUG] MultiThreadedHttpConnectionManager - -Getting free connection, hostConfig=HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000]
2005/02/09 18:54:59:760 CET [DEBUG] header - ->> "GET http://cxtst.xrce.xerox.com/my/ HTTP/1.1[\r][\n]"
2005/02/09 18:54:59:760 CET [DEBUG] HttpMethodBase - -Adding Host request header
2005/02/09 18:54:59:761 CET [DEBUG] header - ->> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)[\r][\n]"
2005/02/09 18:54:59:761 CET [DEBUG] header - ->> "Host: cxtst.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:763 CET [DEBUG] header - ->> "Cookie: SF_THEME=000000codex[\r][\n]"
2005/02/09 18:54:59:763 CET [DEBUG] header - ->> "Cookie: SF_FONTSIZE=0000002[\r][\n]"
2005/02/09 18:54:59:764 CET [DEBUG] header - ->> "Cookie: session_hash=90555e7ba5dc7399a44a196e8165c978[\r][\n]"
2005/02/09 18:54:59:764 CET [DEBUG] header - ->> "Proxy-Connection: Keep-Alive[\r][\n]"
2005/02/09 18:54:59:764 CET [DEBUG] header - ->> "[\r][\n]"
2005/02/09 18:54:59:861 CET [DEBUG] header - -<< "HTTP/1.0 302 Moved Temporarily[\r][\n]"
2005/02/09 18:54:59:871 CET [DEBUG] header - -<< "Date: Wed, 09 Feb 2005 17:43:44 GMT[\r][\n]"
2005/02/09 18:54:59:871 CET [DEBUG] header - -<< "Server: Apache/2.0.48 (RHEL 3)[\r][\n]"
2005/02/09 18:54:59:871 CET [DEBUG] header - -<< "Accept-Ranges: bytes[\r][\n]"
2005/02/09 18:54:59:871 CET [DEBUG] header - -<< "X-Powered-By: PHP/4.3.2[\r][\n]"
2005/02/09 18:54:59:871 CET [DEBUG] header - -<< "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:43:44 GMT; path=/[\r][\n]"2005/02/09 18:54:59:872 CET [DEBUG] header - -<< "Location: /account/login.php?return_to=%2Fmy%2F[\r][\n]"
2005/02/09 18:54:59:872 CET [DEBUG] header - -<< "Content-Length: 0[\r][\n]"
2005/02/09 18:54:59:872 CET [DEBUG] header - -<< "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
2005/02/09 18:54:59:872 CET [DEBUG] header - -<< "X-Cache: MISS from www-cache.grenoble.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:872 CET [DEBUG] header - -<< "Proxy-Connection: keep-alive[\r][\n]"
2005/02/09 18:54:59:874 CET [DEBUG] HttpMethodBase - -Cookie accepted: "SF_FONTSIZE=0000002"
2005/02/09 18:54:59:874 CET [DEBUG] HttpMethodDirector - -Redirect required
2005/02/09 18:54:59:874 CET [DEBUG] HttpMethodDirector - -Redirect requested to location '/account/login.php?return_to=%2Fmy%2F'
2005/02/09 18:54:59:875 CET [DEBUG] HttpMethodDirector - -Redirect URI is not absolute - parsing as relative
2005/02/09 18:54:59:875 CET [DEBUG] HttpMethodDirector - -Redirecting from 'http://cxtst.xrce.xerox.com:80/my/' to 'http://cxtst.xrce.xerox.com:80/account/login.php
2005/02/09 18:54:59:876 CET [DEBUG] HttpMethodDirector - -Execute redirect 1 of 100
2005/02/09 18:54:59:876 CET [DEBUG] HttpMethodBase - -Should NOT close connection in response to directive: keep-alive
2005/02/09 18:54:59:906 CET [DEBUG] header - ->> "GET http://cxtst.xrce.xerox.com/account/login.php?return_to=%2Fmy%2F HTTP/1.0[\r][\n]"
2005/02/09 18:54:59:906 CET [DEBUG] HttpMethodBase - -Adding Host request header
2005/02/09 18:54:59:906 CET [DEBUG] header - ->> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)[\r][\n]"
2005/02/09 18:54:59:907 CET [DEBUG] header - ->> "Host: cxtst.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:907 CET [DEBUG] header - ->> "Cookie: SF_THEME=000000codex[\r][\n]"
2005/02/09 18:54:59:907 CET [DEBUG] header - ->> "Cookie: session_hash=90555e7ba5dc7399a44a196e8165c978[\r][\n]"
2005/02/09 18:54:59:907 CET [DEBUG] header - ->> "Cookie: SF_FONTSIZE=0000002[\r][\n]"
2005/02/09 18:54:59:907 CET [DEBUG] header - ->> "Proxy-Connection: Keep-Alive[\r][\n]"
2005/02/09 18:54:59:908 CET [DEBUG] header - ->> "[\r][\n]"
2005/02/09 18:54:59:951 CET [DEBUG] header - -<< "HTTP/1.0 200 OK[\r][\n]"
2005/02/09 18:54:59:952 CET [DEBUG] header - -<< "Date: Wed, 09 Feb 2005 17:43:44 GMT[\r][\n]"
2005/02/09 18:54:59:952 CET [DEBUG] header - -<< "Server: Apache/2.0.48 (RHEL 3)[\r][\n]"
2005/02/09 18:54:59:952 CET [DEBUG] header - -<< "Accept-Ranges: bytes[\r][\n]"
2005/02/09 18:54:59:952 CET [DEBUG] header - -<< "X-Powered-By: PHP/4.3.2[\r][\n]"
2005/02/09 18:54:59:953 CET [DEBUG] header - -<< "Expires: Wed, 11 Nov 1998 11:11:11 GMT[\r][\n]"
2005/02/09 18:54:59:953 CET [DEBUG] header - -<< "Cache-Control: must-revalidate[\r][\n]"
2005/02/09 18:54:59:953 CET [DEBUG] header - -<< "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:43:44 GMT; path=/[\r][\n]"2005/02/09 18:54:59:954 CET [DEBUG] header - -<< "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
2005/02/09 18:54:59:954 CET [DEBUG] header - -<< "X-Cache: MISS from www-cache.grenoble.xrce.xerox.com[\r][\n]"
2005/02/09 18:54:59:954 CET [DEBUG] header - -<< "Proxy-Connection: close[\r][\n]"
2005/02/09 18:54:59:956 CET [DEBUG] HttpMethodBase - -Cookie accepted: "SF_FONTSIZE=0000002"
2005/02/09 18:55:00:056 CET [DEBUG] HttpMethodBase - -Should close connection in response to directive: close
2005/02/09 18:55:00:056 CET [DEBUG] HttpConnection - -Releasing connection back to connection manager.
2005/02/09 18:55:00:056 CET [DEBUG] MultiThreadedHttpConnectionManager - -Freeing connection, hostConfig=HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000]
2005/02/09 18:55:00:056 CET [DEBUG] IdleConnectionHandler - -Adding connection at: 1107971700056
2005/02/09 18:55:00:057 CET [DEBUG] MultiThreadedHttpConnectionManager - -Notifying no-one, there are no waiting threads
Codex project name: maven-plugin
2005/02/09 18:55:00:298 CET [DEBUG] MultiThreadedHttpConnectionManager - -HttpConnectionManager.getConnection: config = HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000], timeout = 0
2005/02/09 18:55:00:299 CET [DEBUG] MultiThreadedHttpConnectionManager - -Getting free connection, hostConfig=HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000]
2005/02/09 18:55:00:299 CET [DEBUG] HttpConnection - -Open connection to cornillon:8000
2005/02/09 18:55:00:300 CET [DEBUG] header - ->> "GET http://cxtst.xrce.xerox.com/file/admin/editpackages.php?group_id=102 HTTP/1.1[\r][\n]"
2005/02/09 18:55:00:300 CET [DEBUG] HttpMethodBase - -Adding Host request header
2005/02/09 18:55:00:300 CET [DEBUG] header - ->> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)[\r][\n]"
2005/02/09 18:55:00:301 CET [DEBUG] header - ->> "Host: cxtst.xrce.xerox.com[\r][\n]"
2005/02/09 18:55:00:301 CET [DEBUG] header - ->> "Cookie: SF_THEME=000000codex[\r][\n]"
2005/02/09 18:55:00:301 CET [DEBUG] header - ->> "Cookie: session_hash=90555e7ba5dc7399a44a196e8165c978[\r][\n]"
2005/02/09 18:55:00:301 CET [DEBUG] header - ->> "Cookie: SF_FONTSIZE=0000002[\r][\n]"
2005/02/09 18:55:00:301 CET [DEBUG] header - ->> "Proxy-Connection: Keep-Alive[\r][\n]"
2005/02/09 18:55:00:302 CET [DEBUG] header - ->> "[\r][\n]"
2005/02/09 18:55:00:356 CET [DEBUG] header - -<< "HTTP/1.0 200 OK[\r][\n]"
2005/02/09 18:55:00:357 CET [DEBUG] header - -<< "Date: Wed, 09 Feb 2005 17:43:45 GMT[\r][\n]"
2005/02/09 18:55:00:357 CET [DEBUG] header - -<< "Server: Apache/2.0.48 (RHEL 3)[\r][\n]"
2005/02/09 18:55:00:360 CET [DEBUG] header - -<< "Accept-Ranges: bytes[\r][\n]"
2005/02/09 18:55:00:360 CET [DEBUG] header - -<< "X-Powered-By: PHP/4.3.2[\r][\n]"
2005/02/09 18:55:00:360 CET [DEBUG] header - -<< "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:43:45 GMT; path=/[\r][\n]"2005/02/09 18:55:00:361 CET [DEBUG] header - -<< "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
2005/02/09 18:55:00:362 CET [DEBUG] header - -<< "X-Cache: MISS from www-cache.grenoble.xrce.xerox.com[\r][\n]"
2005/02/09 18:55:00:362 CET [DEBUG] header - -<< "Proxy-Connection: close[\r][\n]"
2005/02/09 18:55:00:363 CET [DEBUG] HttpMethodBase - -Cookie accepted: "SF_FONTSIZE=0000002"
2005/02/09 18:55:00:408 CET [DEBUG] HttpMethodBase - -Should close connection in response to directive: close
2005/02/09 18:55:00:408 CET [DEBUG] HttpConnection - -Releasing connection back to connection manager.
2005/02/09 18:55:00:408 CET [DEBUG] MultiThreadedHttpConnectionManager - -Freeing connection, hostConfig=HostConfiguration[host=http://cxtst.xrce.xerox.com, proxyHost=http://cornillon:8000]
2005/02/09 18:55:00:408 CET [DEBUG] IdleConnectionHandler - -Adding connection at: 1107971700408
2005/02/09 18:55:00:409 CET [DEBUG] MultiThreadedHttpConnectionManager - -Notifying no-one, there are no waiting threads
Oleg Kalnichevski wrote:
On Wed, Feb 09, 2005 at 04:16:08PM +0100, Michael Niemaz wrote:
- Why are redirections forbidden in v3.0?
What makes you think so?
I re-compiled my code with v3.0rc1 and ran it as it is; I get the following error:
/Entity enclosing requests cannot be redirected without user intervention
/
See <http://jakarta.apache.org/commons/httpclient/3.0/redirects.html> for explanations
What are /Entity enclosing requests?/a
Methods that submit a request body such as POST and PUT
But it might be, as you suggested, a problem with my code using the old API.
What do you think?
Neither HttpClient 2.0 nor 3.0 automatically redirect POST requests. You have to write a little bit of code around HttpClient to convert POST request into GET.
Another stupid question:
I keep getting this message: "Response content length is not known". i suspect
it comes from the HttpMethodBase#readResponseBody method.
How could I get rid of it?
See <http://jakarta.apache.org/commons/httpclient/3.0/performance.html#Request/Response%20entity%20streaming>
Or more precisely how to parameterize the logging
mechanisms used in the httpClient library?
See <http://jakarta.apache.org/commons/httpclient/3.0/logging.html>
Hope this helps,
Oleg
.
