Well, you'll need to create an absolute path in the reconstructed version.

You can try something like this:

Inside of an HttpServlet...

import java.net.URL;

int otherPort = 80; // or 8080, whatever.
String relativeResource = "the/relative/path/to/file.html";
String thisRequestURL = getRequestURL(); // getRequestURL is from
HttpServlet
URL otherPortContextURL = new URL(thisRequestURL);
otherPortContextURL.setPort(otherPort);
URL otherPortFromRelativeURL = new URL(otherPortContextURL,
relativeResource);

Look up java.net.URL in the docs for detail.

Regards,

Will Hartung
([EMAIL PROTECTED])

----- Original Message -----
From: "Alvin Wang" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Friday, July 12, 2002 3:02 PM
Subject: how to use relative path to point to a file which's on the same
host, but on a different port number?


> Hi! All,
>
> In http path, how to use relative path to point to a file which's on the
> same host, but on a different port number? For example I have IIS(80) and
> Tomcat(8080) on the same host....
>
> thanks!
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to