I am seeing a problem with the ServletRequest getServerName() method.
On JBoss and Weblogic, this method returns the host name exactly as it
was specified in the request.
If the original request was:
http://fooHost/dir1/dir2/some.html
getServerName() returns "fooHost" as the server name for JBoss and
Weblogic.
But on Oracle Application Server, getServerName() returns the fully
qualified host name, e.g. "fooHost.acme.com". This causes problems with
an AJAX call that attempts to match "fooHost" with "fooHost.acme.com",
and fails because the two strings don't match (even though they point
to the same server).
Does any one know a more reliable way to get the host name (in a form
that matches the original request)? Is there a better option than
getServerName()?
Raymond DeCampo - 24 Jan 2006 21:44 GMT
> I am seeing a problem with the ServletRequest getServerName() method.
> On JBoss and Weblogic, this method returns the host name exactly as it
[quoted text clipped - 16 lines]
> that matches the original request)? Is there a better option than
> getServerName()?
The problem with Oracle AS is that you are likely accessing the
containers via Web Cache and/or Apache. When relaying the request,
Oracle probably uses the fully qualified domain name to find the next
node in the chain. So by the time it gets to the J2EE containers, there
may be no way to distinguish between a request for "foohost" and
"foohost.acme.com".
HTH,
Ray

Signature
This signature intentionally left blank.