• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

LocalHost in request.serverName()

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have my Web application on Tomcat server(without Apache).
The IP is mapped to some DSN.
In my JSP when i fetch the name of the server(request.serverName() )
it is displayed it as LocalHost and not the server name.
Does any configuration need to be done?
Thanks in Advance.
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe this is web container specific. Each web container usually has it's own config file (catalina.xml I believe for Tomcat) that allows configuration of vendor specific properties. Most likely, localhost is configured in this file as the server name. Try playing with it and switching to the IP of the machine instead.
I'm not sure this will work, but I've had a similar problem with the host URL/name in the container I'm using and it was a vendor specific issue.
 
A teeny tiny vulgar attempt to get you to buy our stuff
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic