What is the class that is executed at the start of a JAVA EE WildFly project?
I know it's a very beginner question. But I have a gigantic project to study and I can not determine where the system starts. It is a Java EE project in WildFly.
What is the class that is executed at the start of a JAVA EE WildFly project?
I know it's a very beginner question. But I have a gigantic project to study and I can not determine where the system starts. It is a Java EE project in WildFly.
There should be a web.xml file in the project. Start there, it will have a list of servlets and other web resources. The servlets will have mappings to classes. The start of the execution of a request will start in the web methods of that class (e.g. doGet, doPost, etc.).
For example:
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.mycompany.myproject.MyServletImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/DoSomething</url-pattern>
</servlet-mapping>
You can also have code executed when a web application is deployed as described here: Using special auto start servlet to initialize on startup and share application data
Web applications don't have a main; the 'program' that is running is actually the web container (Apache Tomcat, Glassfish, JBoss, Weblogic, Wildfly in your case) and that program will service the web application(s) you deploy into it. You might want to read the JEE tutorial to learn and understand what a Java web environment is.
https://docs.oracle.com/javaee/7/tutorial/
From: Why don't I see any main method in this java dynamic web project?