【发布时间】:2023-02-25 17:37:42
【问题描述】:
I was tryin to understand the difference between jar and war file, whether war file can be run on embedded tomcat server and gradually stumbled upon , starting of tomcat server. Which brought me to the following code line :
Tomcat tomcat = new Tomcat();
However i do not see this line anywhere in my personal projects, enterprise projects. I was imagining if Springboot automatically creates bean of tomcat server. And eventually led me to following documentation- embedded_servers_tomcat
Below is the screenshot of the lines :
Can someone explain what are these necessary bits and if possible please post the links for following if your have relevant resources for :
- Can war files be run using if so how ?
- Why do i not see the line Tomcat tomcat = new Tomcat(); in my java projects ?
- Why do we need war files , when we have the option to run jar files ?
- When we deploy application on linux servers , if we have multiple applciations , so multiple instances of tomcat servers is required (one standalone tomcat and multiple instances (Tomcat x1 = new Tomcat())) or multiple tomcat servers are required ?
I have 2.5 years of experience as a java-angular web application developer and I try learning daily and improving and understanding daily on how web applications work. Any help to answer my queries will be appreciated. Please don't downvote if you find my question naiive. We all begin somewhere , right !
I tried reading the documentation and watching videos on YouTube and blogs from javaatpoint etc. nothing gave me a clear or concise idea about the same.
-
Thanks for downvoting , i hope it made you look cool.
标签: java spring-boot eclipse maven tomcat