为什么一个javaweb项目里有多个main函数?

原文地址::https://zhidao.baidu.com/question/1704581714638407700.html

相关文章

1、一个java文件为什么可以有两个main函数----https://zhidao.baidu.com/question/2120745906443829787.html

2、web项目没有main方法,怎么运行的?----https://blog.csdn.net/lyt_7cs1dn9/article/details/52469472

类中的main函数,在java web应用中,没有任何的作用,web应用启动是不会执行类中的main方法的,因为只会调用tomcat或者其它应用服务器的main,然后通过web.xml的配置去加载其它类,公司的java web项目的main方法,纯属测试用的。

猜你喜欢

转载自blog.csdn.net/xqhrs232/article/details/83989113