getRemoteHost() returns local loop back address not uri

Posted on 2009-04-30
Last Modified: 2012-05-06

Not at all familar with JSP, but received some help previously setting up a switch between environments.  However the getRemoteHost() is returning the local loop back address rather than the URI.
if (request.getRemoteHost().equals("")) {*/

				// TEST

				DebugLog.write("Hostname Test:"+request.getRemoteHost()+FileNwline);

				db_host 			= "xxx";

				db_service_name 	= "xxx";

				stringZopeURL 	= "hxxx";

				stringTTWP 		= "";

			} else if (request.getRemoteHost().equals("")){

Open in new window

Question by:vrmetro
    LVL 12

    Expert Comment

    by:Gibu George
    add and the hostname you want to be returned to the hosts file

    Author Comment

    not sure what that means, again real new on JSP; mind an example?
    LVL 12

    Accepted Solution

    If you are using windows machine

    goto <Windows folder>\system32\drivers\etc\

    open the hosts file and add the entry <hostname you want to display>

    save it

    restart the server

    Author Comment

    I'll give it a whirl and let you know, thanks

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now