Use Tomcat embedded within JBoss.
Thanks for the reply. So do you recommend me to un-install the Tomcat that I have already installed, then install the JBoss + Tomcat?
JBoss deals with the other components of a J2EE architecture, EJBs - scalable, transactionally sound, remote data processing components. Your web applications through servlets and JSPs are the presentation layer but they only represent one means of presenting data. Web services, Java GUI even flat files are other means for delivering information for consumption.
So, in a sense you don't want your servlets to be performing the essential task of assembling and processing disparate data - you don't want that embedded in your web application as it is quite likely that other services are going to want that same information and processing. Otherwise, should each application assemble the data, you run into data integrity and maintenance issues down the track when things change. You have to modify the assembly in X places. And I have seen this - in a commercial application, the web application had to bring the procurement data together, and engineers had built the data maintenance as a Java GUI with it's own data management routines. As things got more complex, the maintenance increased more than twofold and there were still problems as there were slightly different views of the data. The final straw came when the client wanted to deliver data in a Web service fashion as well.
So EJBs can be viewed in one sense as the guardian to data - it is the one point for accessing data and it tells you how you may request that data, and what data you will get - irrespective of the context provided by the presentation layer. And EJBs run in JBoss, an EJB container (among other things).
Embedded Tomcat (or Jetty) is also managed by the JBoss microkernel. And within Tomcat, a servlet container, run your servlets and JSPs.
Your servlets request data or provide data to the EJBs and they store or retrieve data for you. When the EJBs and servlets run within the same JVM, they don't need to communicate across the wire, so things ar faster. WebSphere, WebLogic and SilverStream similarly combine their servlet and EJB containers.
It is better from a memory and speed perspective to run the embedded Jetty or Tomcat rather than a standalone configuration. You would run these separate if you were intending to split the containers across machines.
Hope that helps.