Home >Java >javaTutorial >How to start the main function in springboot project
Create a new appController class under the controller package
package controller; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; @SpringBootApplication public class appController extends SpringBootServletInitializer { public static void main(String[] args){ SpringApplication.run(appController.class,args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(appController.class); } }
New indexController
Create a new proController class
#Start the main function in the appController class
Browser input: localhost:8080 /proo
Browser input: localhost:8080/index
##Detailed explanation of SpringBoot main method@SpringBootApplication public class UdeamApplication { public static void main(String[] args) { SpringApplication.run(UdeamApplication.class, args); } }
The above is the detailed content of How to start the main function in springboot project. For more information, please follow other related articles on the PHP Chinese website!