I am creating a J2EE application with tomcat as appliation server and ApacheHttpd as web server. How can i achieve threadpooling using Tomcat, and does a thread loses its state once it is returned to the thread pool.
Tomcat uses a thread pool already. You can control the number of threads allowed with the minProcessors and maxProcessors values. You can change these in the server.xml file, which is described well by this guy: