In order to access a Java servlet from a browser, you must tell the browser on which machine and port the servlet resides. The IP address or host name of the machine is the primary location-identifier used to find any machine located on an intranet or the Internet. An optional port number can be specified. Along with the IP address or host name and the optional port number, you must specify the servlet's context relative to the IP address or host name.
The name "localhost" is typically the default name that is mapped to a Web/HTTP server's IP address when referencing it from the same machine. Other names can be mapped to the machine's IP address, as well. In your case, "localhost" and "abc" have been mapped to your machine's IP address. When the port number is omitted, port 80 is assumed.
Some example URLs for a servlet called "myservlet" on your local machine might be:
Dig Deeper on Topics Archive
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.