Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

ServletRequest - can I get the host name exactly as requested?

Thread view: 
pwfarwell@yahoo.com - 24 Jan 2006 20:43 GMT
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.