Changeset 6269
- Timestamp:
- 2003-12-16T11:09:46+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/java/org/nzdl/gsdl/Phind/Phind.java
r3178 r6269 498 498 // the address has all the necessary components 499 499 } else if (address.startsWith("/")) { 500 // there is no tprotocol and host500 // there is no protocol and host 501 501 URL document = getDocumentBase(); 502 String protocol = document.getProtocol(); 503 String host = document.getHost(); 502 504 String port = ""; 503 505 if (document.getPort()!=-1) { 504 506 port = ":" + document.getPort(); 505 507 } 506 address = "http://" + document.getHost() + port+ address;508 address = protocol + "://" + host + port + address; 507 509 } else { 508 510 // this URL is relative to the directory the document is in 509 511 URL document = getDocumentBase(); 512 String protocol = document.getProtocol(); 513 String host = document.getHost(); 510 514 String directory = document.getFile(); 511 515 int end = directory.lastIndexOf('/'); 512 516 String port = ""; 513 if (document.getPort() !=-1) {517 if (document.getPort() != -1) { 514 518 port = ":" + document.getPort(); 515 519 } 516 directory = directory.substring(0,end + 1); 517 address = "http://" + document.getHost() + port + directory + address; 518 519 } 520 521 // if the URL is a cgi script, make sure it has a "?" in ti, 520 directory = directory.substring(0, end + 1); 521 address = protocol + "://" + host + port + directory + address; 522 } 523 524 // if the URL is a cgi script, make sure it has a "?" in it, 522 525 // and that it ends with a "?" or "&" 523 526 if (isCGI) {
Note:
See TracChangeset
for help on using the changeset viewer.