When you compile a class that contains anonymous classes, there are multiple .class
files generated. For example, you would have Winning.class
for the top level class and Winning$1.class
for the first anonymous inner class.
If you only put Winning.class
in /WEB-INF/classes
, then you would get a ClassNotFoundException
when the code tries to load the anonymous class.