Can jar packages be deployed in tomcat like war packages and then accessed? How can it be deployed, and if not, why?

the jar package does not start the jar package with java-jar, but is deployed in tomcat for access like the war package. Is that OK? If you can, how should you play? if not, can you give me a detailed explanation?

Aug.30,2021

theoretically can. For example, that's what spring boot does. You will find that the war packages generated by spring boot can be executed not only by java-jar xxx.war, but also by servlet containers. To put it bluntly, as long as the executable jar package is packaged according to the war package specification, embedded a starter guide to execute, done. I suggest you take a look at spring boot's plan.

Menu