why tomcat has its own classloader. what is the advantage of having user defined classloader
Tomcat (and other application containers) need to be able to handle loading classes from WAR files etc. How would you be able to do that without using user-defined classloaders?
EDIT: Basically you need user-defined classloaders if you need to load classes or resources in "unusual" ways... such as from an EAR or WAR file. As another example, you might load classes from a database, or from some secure storage.