This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Tomcat and the fly likes req.getServerName() and req.getServerPort() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "req.getServerName() and req.getServerPort()" Watch "req.getServerName() and req.getServerPort()" New topic
Author

req.getServerName() and req.getServerPort()

Renato Losio
Ranch Hand

Joined: Nov 23, 2005
Posts: 99
Hello.

I have a web app running on JBoss that relies on the req.getServerName() and req.getServerPort() to generate invitation emails for new users. I have:

req.getServerPort() = 80
req.getServerName() = my.server.com

and everything works fine. If I add an Apache server on port 80 the box that redirects the request to JBoss on 8080, I have:

req.getServerPort() = 8080
req.getServerName() = 127.0.0.1

and that's not nice. As that's not very useful indeed to the user :-(

Did I set anything wrong in Apache or is a flow in my app design?

Regards,

Renato



Everything


Renato Losio - www.arsenio.it - renatoweb@arsenio.it
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Moved from Servlets to Apache/Tomcat


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
GeeCON Prague 2014
 
subject: req.getServerName() and req.getServerPort()