Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About ServerPort, ServerAddr, LocalPort

 
Kathiresan Chinna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Statement:
Given a request from coderanch.forum.com, with an IP address of 192.168.1.10 on port 8085


Which methods of ServletRequest return the following values ?
coderanch.forum.com - ?
192.168.1.10 - ?
8085 - ?

Regards
Kathir
 
Lee Kian Giap
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question not clear enough to have an answer ...

request from

OR

request to/for

?

 
Abdul Rahman
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kathir,

coderanch.forum.com - request.getRemoteHost());
192.168.1.10 - request.getRemoteAddr());
8085 - request.getRemotePort());

Here request is an object of HttpServletRequest.
 
Kathiresan Chinna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes, it is confusing me too. I think
coderanch.forum.com - request.getRemoteHost());
192.168.1.10 - request.getRemoteAddr());
8085 - request.getLocalPort());

Kathir
 
Abdul Rahman
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kathir,

what was confusing ? My answer or your question

your question says :
Given a request from coderanch.forum.com
.
so basically its the server which asks from where the request is coming. Hence we have all those remote methods to determine the remote user requesting for the resource.

Hope that clarifies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic