You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by cm...@apache.org on 2003/01/01 20:15:17 UTC
cvs commit: jakarta-cactus/framework/src/java/share/org/apache/cactus/client HttpClientConnectionHelper.java
cmlenz 2003/01/01 11:15:17
Modified: framework/src/java/share/org/apache/cactus/util
HttpURLConnection.java
framework/src/java/share/org/apache/cactus/client
HttpClientConnectionHelper.java
Log:
- Deprecate the Cactus HttpURLConnection adapter for
Commons-HttpClient, which has been donated to the HttpClient code
base a while ago.
- In HttpClientConnectionHelper, use the HttpURLConnection adapter
from Commons-HttpClient instead of the one in the Cactus code base.
- Use the HttpClient class HostConfiguration with the execute() method,
instead of the deprecated HttpClient.startSession(...) method
Revision Changes Path
1.4 +7 -2 jakarta-cactus/framework/src/java/share/org/apache/cactus/util/HttpURLConnection.java
Index: HttpURLConnection.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/HttpURLConnection.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HttpURLConnection.java 31 Aug 2002 18:17:01 -0000 1.3
+++ HttpURLConnection.java 1 Jan 2003 19:15:17 -0000 1.4
@@ -80,7 +80,12 @@
* the numerous <code>HttpURLConnection</code> bugs!).
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
- *
+ *
+ * @deprecated This class has been donated to the
+ * <a href="http://jakarta.apache.org/commons/httpclient/">Jakarta
+ * Commons-HttpClient</a> project, and is now maintained there as
+ * <code>org.apache.commons.httpclient.util.HttpURLConnection</code>.
+ *
* @version $Id$
*/
public class HttpURLConnection extends java.net.HttpURLConnection
1.7 +11 -8 jakarta-cactus/framework/src/java/share/org/apache/cactus/client/HttpClientConnectionHelper.java
Index: HttpClientConnectionHelper.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/HttpClientConnectionHelper.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- HttpClientConnectionHelper.java 31 Dec 2002 11:42:37 -0000 1.6
+++ HttpClientConnectionHelper.java 1 Jan 2003 19:15:17 -0000 1.7
@@ -66,7 +66,9 @@
import org.apache.cactus.WebRequest;
import org.apache.cactus.client.authentication.AbstractAuthentication;
import org.apache.cactus.util.UrlUtil;
+import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.Protocol;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
@@ -166,15 +168,16 @@
// Open the connection and get the result
HttpClient client = new HttpClient();
-
- client.startSession(url.getHost(), url.getPort(),
- url.getProtocol().equalsIgnoreCase("HTTPS"));
- client.executeMethod(this.method);
+ HostConfiguration hostConfiguration = new HostConfiguration();
+ hostConfiguration.setHost(url.getHost(), url.getPort(),
+ Protocol.getProtocol(url.getProtocol()));
+ client.executeMethod(hostConfiguration, this.method);
// Wrap the HttpClient method in a java.net.HttpURLConnection object
- return new org.apache.cactus.util.HttpURLConnection(this.method, url);
+ return new org.apache.commons.httpclient.util.HttpURLConnection(
+ this.method, url);
}
-
+
/**
* Add the HTTP parameters that need to be passed in the request body.
*
@@ -245,4 +248,4 @@
((PostMethod) this.method).setRequestBody(theRequest.getUserData());
}
-}
\ No newline at end of file
+}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>