for someserver.com, should it be request.getServerName() ?
It seems to me that :
1. the client is running at 10.10.2.23 using port number 2260.
2 .the client sends the request to the servlet at someserver.com and the receiving port is 8080.
About Question enthuware.jwpv6.2.1069 :
Moderator: admin
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
-
- Site Admin
- Posts: 10072
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.1069 :
No, as per http://docs.oracle.com/javaee/6/api/jav ... ServerName():
getServerName returns the host name of the server to which the request was sent. It is the value of the part before ":" in the Host header value, if any, or the resolved server name, or the server IP address.
getServerName returns the host name of the server to which the request was sent. It is the value of the part before ":" in the Host header value, if any, or the resolved server name, or the server IP address.
If you like our products and services, please help us by posting your review here.
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.1069 :
I assume the url in the question is :
http://www.someserver.com:8080/MyContext/index.jsp.
The client is at 10.10.2.23:2262?
So, to return http://www.someserver, it should be getServerName ?
It is just like http://localhost:8080/MyContext/index.jsp.
And the localhost is to where the request is sent.
http://www.someserver.com:8080/MyContext/index.jsp.
The client is at 10.10.2.23:2262?
So, to return http://www.someserver, it should be getServerName ?
It is just like http://localhost:8080/MyContext/index.jsp.
And the localhost is to where the request is sent.
-
- Site Admin
- Posts: 10072
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.1069 :
No, the problem statement says that the request is coming FROM someserver.com.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 4 guests