This would be an odd way to architect a web app. Can you tell us in more detail what you're trying to accomplish (and why)?
In the meantime, you might want to check out OSGi, which has facilities to ads and remove features from applications based on the presence or absence of so-called bundles (jar files, essentially, with some special configuration).
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Displaying features based on jars present in Tomcat application