If the class to override is called com.example.FooServlet and this class is inside a jar WEB-INF/lib/foo.jar, how to override it with a class also called com.example.FooServlet in another jar, say bar.jar?
Or is there any way to make sure the one in bar.jar is loaded first?
Making bar.jar a module is no-go because the FooServlet imports tons of classes from many jars in WEB-INF/lib.
As I stated above, I tried to contain bar.jar in a module, but got class not found or no class def error (can't remember clearly) as FooServlet extends/implements some extra classes/interfaces which are in 3rd party jars in WEB-INF/lib.
I'm not allowed to touch foo.jar or any of the jars that are already existing in WEB-INF/lib.