Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
102 views
in Technique[技术] by (71.8m points)

java - Is Tomcat really a web server?

I was learning the difference between application server and web server and I read these difference

  1. In web servers, multithreading is not supported.
  2. A Web server will not itself support transactions or database connection pooling

Actually my java application is deployed in Tomcat server and it actually supports multithreading, transactions etc. But I also read that tomcat is a web server. So how is this possible ?

question from:https://stackoverflow.com/questions/65879302/is-tomcat-really-a-web-server

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Once upon a time the web was static. It means webservers were able to serve files from a filesystem via http, much like FTP servers serve files via FTP. First attempts to go dynamic were CGI scripts, which were good for small projects but for bigger ones they would still hurt - in performance and in code maintenance.

One of the alternatives was to have the webserver forward requests to applications running elsewhere/in other processes. One such example is JServ, which was the first servlet container. It was able to run servlets but not serve static files. So you would use it to process dynamic content only.

There you go: You have a webserver for static files, and an application (server) to care about dynamic content.

It did not take long until someone created a servlet that would serve static files - yet a lot of websites still make the distinction as serving static files would cost less resources with a plain webserver.

The resource overhead is not that painful today, and thus you can use application servers as replacements for webservers. And still webservers are commonly used before application servers, simply to reduce the facade on the web and thus possible attack vectors.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...