I started to develop web applications not so long ago, and therefore there are a lot of unknown things in this field for me. My question concerns web development using the Java language. Assume that we need to develop a client-server application, where the client is a browser. As far as I know, there are at least two ways to communicate.
An HTTP server work on the server side and a container for a Java application (back-end). The HTTP server redirects requests to another port, which is binded with the Java application. The Java application sends to the client pages with dynamic content from a database, for example, as a response to a concrete client's request. The application uses a template enginge for this. Timeleaf or Velocity, for example.
Though I wrote about Java, these approaches are used with other programming languages, Python, for instance.
I was told that the first apprach is considered as bad in the Java community. But I haven't heard concrete arguments. I would like to know them.
Many thanks for your time and answers.