We all know that the browser is responsible for redirecting the request once it receives the response status code 3xx.
But this time, I am sending a request from the back end code of the application using URLConnection. My application is running on a tomcat server.
Now what if I get a response status code 3xx, will the tomcat itself take care of redirecting the request or should I handle it in my application as :
if(urlConnection.getResponseCode() == 302)
{
// make a new request to URL found in Location Header
}