getDocumentRoot from URL Connection
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chris_lambrou
Posted On:   Wednesday, June 27, 2001 05:46 PM

Hello, I am in need of getting the
CGI env variable "DOCUMENT_ROOT" from
a URL connection. Is this possible?

Re: getDocumentRoot from URL Connection

Posted By:   Tim_Rohaly  
Posted On:   Wednesday, June 27, 2001 06:49 PM

Um, CGI environment variables are set by the web server
for use by CGI programs on that web server.
They are not sent over the net.
So I don't understand why you say you need to
get this variable from a URLConnection.
You can't get this variable from the client side (this has
nothing to do with Java!), and from the
server side 1) you probably shouldn't be using Java for
CGI, use servlets instead, and 2) URLConnection
has nothing to do with the web server configuration, hence
cannot be used to determine the value of this property.

Re: getDocumentRoot from URL Connection

Posted By:   AlessandroA_Garbagnati  
Posted On:   Wednesday, June 27, 2001 06:16 PM

Chris,


No, you can't for many reasons (one among them: security).


The only way is having the page you're requesting, or the web server itself, to expose that piece of information somewhere (maybe in a header field).

About | Sitemap | Contact