• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getServerPort() vs getLocalPort()

 
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In which context these two methods are used on request object? Whats the difference?
Thanks
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
getServerPost() says, "to which port was the request originally sent?"
getLocalPost() says, "on which port did the request end up with?"

all request are send to a single port(server port), where the server is listening. then the server find another port(Local port) to handle this thread, so that the app server can handle many client at the sametime.
 
Rajan Chinna
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It means this is useful when we configure Apache & Tomcat together.

Lets say I configure Apache at port 80 and Tomcat at port 8080, can i say getServerPost() refers to port 80 and getLocalPost() refers to 8080 port.

Am I right in understanding this?

Lets say I use only Tomcat at port 80 in this case I cannot use getLocalPost() rite?

Thanks
 
A feeble attempt to tell you about our stuff that makes us money
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic