Issue
I was reading the headfirst book about JSP and Servlets and I found out that different servlets have different ports and you should always ask which port is available when developing your own servlet.
Now this might have a very simple answer but I ran my servlet from this url:
http://localhost:8080/ch1/Serv1
Does that mean that my servlet has the port 8080? Can you please point me to a link which will explain these things in better detail?
All I get from Google searches is exactly what says in the book ( which I'm sure is right ) that all servlets have different ports.
Thank you
Solution
Servlets are not bound to a port. The server (tomcat or jetty or whatever) is bound to a port.
Your Servlet is bound to a path.
Answered By - Christian Kuetbach
Answer Checked By - Terry (JavaFixing Volunteer)