On Thu, 16 Sep 1999, Craig R. McClanahan wrote:

> Milt Epstein wrote:
>
> > I do realize that the JSDK API docs (at least for JSDK 2.0), as well
> > as Jason Hunter's book, indicates that getServerName() is the same as
> > SERVER_NAME, but that is apparently not the behavior I'm getting.
>
> This hasnt changed, in either 2.1 or the 2.2 draft API docs.
>
> I just tried with JSWDK on my Linux box, using the "snoop" JSP
> example.  I get the server name used in the request when I use
> either of the following URLs (with the hostname obviously being my
> own):
>
>     http://www.myserver.com:8080/examples/jsp/snp/snoop.jsp
>
>     http://localhost:8080/examples/snp/snoop.jsp

You're saying that when you use getServerName(), you get
"www.myserver.com" and "localhost", respectively, with these two URLs,
right?  Fine, that *is* the behavior I'm getting as well.

What I'm saying, though, is that apparently this is how HTTP_HOST
behaves in the CGI world, not SERVER_NAME.  So it's not the behavior
of getServerName() per se that's in question, but which CGI
environment variable behaves the same way.

(And to answer part of my original question, it looks like with
servlets there is no way to get the configured server name, as there
is with CGI.)


> > I should say I'm using a pre-release version of ServletExec 2.1 as my
> > servlet engine.  I haven't tried it with any other servlet engines.
>
> Sounds like there might be a bug in their implementation, and/or in their
> connector with NES.

I believe some of their people read this list, so perhaps they can
comment (if they're not totally confused at this point :-).

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to