I have several J2EE projects using servlets, each of which extends from a base class that handles the main doGet and doPost methods and calls more specific methods on the subclasses. Rather than have that base class as a class in each WAR file, I want to move it to its own JAR that each of the other projects can reference.
I'm using Eclipse. So, I created a new Java project, and moved the base class into there. It complained about not having a reference to servlet-api.jar, so I added it there. Then the other projects complained about not having a reference to that new project, so those references were added.
Now, there's no more complaining, but when I run the project (by opening the servlet class and choosing Run As), it doesn't export the classes from the other project and Tomcat throws an exception when trying to instantiate a subclass of an unknown class.
How do I tell eclipse to export both the servlet project itself and this other java project that it's referencing?