0

A web server is used to process http request and send a response back to the client browser. I was wondering how does a client browser send a http request to the web server? Is it done via socket connection? Which socket connection is used to establish a connection with tomcat web server? Is it using Java sockets or the client browser have it's own socket to establish a connection with the Tomcat server? Or does the client browser uses the socket provided by the operating system to establish a connection to the Tomcat server?

Edited by ~s.o.s~: moved to JSP

3
Contributors
2
Replies
4
Views
4 Years
Discussion Span
Last Post by ~s.o.s~
0

Huh? I am not sure about your question. I don't think a servlet uses socket connection but rather has a listener on a port. I think a HTTP request from a web browser gets through layers of Internet architecture, and the servlet picks up. Then it sends back through the similar layers to the client. If I remember correctly, certain configuration from the server (tomcat in this case) will affect the way of communication as well.

0

Is it done via socket connection?

Yes

Is it using Java sockets or the client browser have it's own socket to establish a connection with the Tomcat server? Or does the client browser uses the socket provided by the operating system to establish a connection to the Tomcat server?

Socket API is provided by the OS. The socket libraries provided by runtimes like JVM(Java), Python, Ruby are all wrappers over the OS sockets. These networking libraries/infrastructure just provide an abstraction so that you don't need to know the implementation details of the socket API for each and every platform/OS.

I don't think a servlet uses socket connection but rather has a listener on a port

This statement is incorrect and doesn't make a lot of sense.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.