What functionality does a Java application server offer, such as JBoss, in front of a Web server such as Tomcat?
What should I take into account when choosing one option over the other?
What functionality does a Java application server offer, such as JBoss, in front of a Web server such as Tomcat?
What should I take into account when choosing one option over the other?
JBoss is an application server that can also be used as a Web server.
Tomcat or Jetty are Servlet containers, and can handle both servlets and JSPs, but not other JEE technologies directly, without adding support in the form of additional libraries (using Spring, for example).
JBoss, being an application server, does support these technologies. Depending on the JBoss version, it will support a different version of JEE.
That said, any decision about what to use should be based on your needs. If you manage a server like Tomcat, either by developing a simple application with servlets or JSPs, or by using a framework like Spring that provides functionality similar to what an application server would give you, that would be enough for you. Otherwise, you will need a server like JBoss.
The division is not between "Web servers" or "Java servers"; All the servers you name are "Web" and "Java".
The difference is that there is a definition of what is the Java Enterprise Edition, which is a standard that defines a series of services that containers ("servers") offer to applications.
To be a container or JEE server the server must provide all the services defined as mandatory for the specifications (eg Glassfish, JBoss, etc.).
Other servers do not provide these services, or only a part (for example Tomcat).
On which one to use, it depends on your needs and, within them, on your tastes. If you only use the EE part of the Web, normally one Tomcat is sufficient, but Glassfish and JBoss are also good if you are more familiar with them. If you start using JEE functionalities, it is better to use a JEE container directly.