I have a web app (go figure servlet - web app) standard url form https://foo.com/appName. It is on a cluster of IBM websphere servers being served by several nodes: hosta.foo.com, hostb.foo.com, hostc.foo.com
My question HttpServletRequest.getServerName() would it be foo.com or hosta.foo.com? (I think just foo.com) with HttpServletRequest.getLocalName() returning hosta.foo.com?
can someone one definitively confirm that behavior?? On my local dev env. It all shows up as localhost.
You can configure alternate domain names to use in place of localhost for testing in your /etc/hosts file -- assuming you're on a real OS. If you are using Windows, I'm sure that there are other ways to do the same thing.