English 中文(简体)
“request.getRemoteAddr()”的结果在不同的浏览器中不同
原标题:The result of "request.getRemoteAddr()" is different in different browsers
  • 时间:2011-02-16 01:26:32
  •  标签:
  • tomcat

I m learning JSP now. I tried to test a very simple sample JSP file, there is one line code inside: ... <% ... out.println("Your IP Address is : " + request.getRemoteAddr()); ... %> ...

I checked this JSP file, it works well, gives me expected information. But, only above code output is different in different browsers:

IE8/谷歌浏览器:输出正确,例如192.168.214.161

但在Firefox/Opera中:我的本地ip地址变成了另一个:192.168.99.211。

我问了我们的网络管理员,但不确定这意味着什么,可能是一个邮件服务器。

So, anybody can teach me why? Besides, my working environment is: Client side: WinXP; Server side: Windws Server 2003 R2/Apache Tocmat 5.5.17, JRE1.5.0_15.

提前谢谢。

最佳回答

也许您的浏览器有不同的代理设置。

问题回答

暂无回答




相关问题
Tomcat´s server.xml dynamic configuration

My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...

热门标签