File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: req.getServerName() and req.getServerPort()
 
Similar Threads
Virtual Host and ProxyPass
port 8080 to 80
port 8080 to 80
Sending parameter with sendredirect
java.io. FileNotFoundException: