Hi all! I'm a really newbye and i'm in a mess with the following thing:

I'm creating a class to resolve relative links given a base uri; Now I use as base uri the uri I typed; but sometimes the remote web server redirects my request to other pages and i can't know what is the real base uri

for example i'm having problems with this:

in a page I have an a element with href=http://www.w3.org/TR/xhtml1

then i notice dusing a browser that the request changes in http://www.w3.org/TR/xhtml1/ (i see in the address bar)

so a "/" is added in the end, that is very different when i compute the base uri

I think that this change is due to a redirection, but i don't know how to make it available to my class;

i tried using:

Header locationHeader = method.getResponseHeader("location");
redirectLocation = locationHeader.getValue();

i read it in http://jakarta.apache.org/commons/httpclient/redirects.html

because i read that the base uri is stored in the response header, but without success;so how can I do it?

for example, how can my browser(mozilla) know that http://www.w3.org/TR/xhtml1 changes in http://www.w3.org/TR/xhtml1/ ??

Best Regards, Davide






Reply via email to