Delimon, Alan wrote:
Recently we converted a servlet using HTTPClient to talk to a webapp
server from 2.02 to 3.0. Under 2.02 everything worked fine.
Under 3.0, when we do a form post using client side javascript in the
webapp server, we get this exception:
java.lang.IllegalArgumentException: Entity enclosing requests cannot be
redirected without user intervention
at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRed
irects(EntityEnclosingMethod.java:221)
The Javadoc for setFollowRedirects says that this was implemented as
part of RFC 2616. Was this added in 3.0, and if so, will I not be able
to use 3.0 to do this type of request? If so I think it's probably OK
for us to use 2.02 for now.
Alan,
Per default HttpClient automatically handles redirects for all non
entity enclosing methods. Just do not PostMethod#setFollowRedirects() to
true in your code and everything should be fine. See the HttpClient
redirect handling guide for details:
http://jakarta.apache.org/commons/httpclient/redirects.html
You can continue using HttpClient 2.0.2 if it still serves you well,
however it is no longer maintained and supported
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]