• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

About ServerPort, ServerAddr, LocalPort

 
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
 
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

?

 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!