This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
getServerName and getServerPort methods returned values that getLocalName and getLocalPort now do. In version 2.4, getServerName and getServerPort have been redefined. Check the API documentation for more information.
Hello When type a url in the browser's address bar, for example http://www.YourServletIsMyServlet.com:8082 The browser opens a socket connection to the server at port 8082, (The port on which the server is listening.Then the browser redirects you to another port because that port is especially for listening to requests and then making redirection
getServerPort returns the port on which the web server is listening getRemotePort returns the port at which the client is connection with you getLocalPort returns the the port after redirection.