File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Trying to Redirect. 302 Error. HTTP CLIENT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Trying to Redirect. 302 Error. HTTP CLIENT" Watch "Trying to Redirect. 302 Error. HTTP CLIENT" New topic
Author

Trying to Redirect. 302 Error. HTTP CLIENT

Raihan Jamal
Ranch Hand

Joined: Mar 23, 2010
Posts: 86
What's wrong with this code. I am getting error on setRedirectStrategy and HttpContext as cannot be resolved to a type. And I am trying to redirect as I am always getting 302 error. So is this the right way to do it. Any example will be appreciated..

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Fix your imports. It's missing a few classes.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Raihan Jamal
Ranch Hand

Joined: Mar 23, 2010
Posts: 86
@Rob Spoor

Edited:- Updated One

After Some modifications in my code, Now I am getting error on setRedirectStrategy as



and error on DefaultRedirectStrategy as



and If I am adding this import to resolve the DefaultDirectStrategy error than I am getting red line on this import as

and error on super as the same as above one



And I am not able to know, what is wrong in this code. Any help will be appreciated. And I am trying to redirect as I am always getting 302 error. So is this the right way to do it. Any example will be appreciated..



Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

DefaultRedirectStrategy is available since HttpClient 4.1. I suggest you upgrade your library.
 
wood burning stoves
 
subject: Trying to Redirect. 302 Error. HTTP CLIENT
 
Similar Threads
HttpClient just wont download a audio file
getContentLength() of HttpURLConnection Problem
Any way to overcome Circular Redirect using HttpClient 4.1.1
Problem in reading Http Response Content
post url connection not working