each Java file should have a Main method
As Sagar pointed out, this is not correct. Very few Java classes have a main method. Only the main class of Java desktop applications have it in order to start them.
Other possibilities are
applets (which are controlled by the browser through the java.applet.Applet interface) and
servlets, which are controlled by the servlet container through the javax.servlet.Servlet interface.
With servlets, the web.xml file contains the name of the class implementing the Servlet interface. This class is then instantiated by the servlet container, and its lifecycle managed through the methods of the Servlet interface.