An application server hosts webapps. I'm pretty sure that JBoss only works with Java, which means that it hosts servlets. Servlets are Java classes that extend javax.servlet.Servlet (or one of its subclasses, commonly javax.servlet.http.HttpServlet) and generally deal with user input through doGet() and doPost() methods. The application server is reponsible for managing connection resources, ports, and all that front-end stuff; basically, abstracting a user's physical connection into a Java ServletRequest object.
That's a very brief overview, but I hope it answers your question. If you have more information, Google is your friend as there's loads of articles out there about servlets and their containers.