Home
» Posts filed under
tomcat
June 26, 2021
Ravi Yasas
Web vs application servers
Introduction
- The application server is the super one.
- Each application server contains an inbuilt web server.
- If you are not satisfied with the inbuilt server, you can add another web server to the application server.
What is the difference?
Web server | Application server |
Ex: Tomcat, Jetty, Resin | Ex: Glassfish, Wildfly, JBoss, WebSphere |
Not J2EE compatible | J2EE compatible |
Can run web applications only | Can run both web and enterprise applications |
Support for HTML, JSP, Servlets... | Support for HTML, JSP, Servlets, EJB, JMS...etc as well. |
June 25, 2021
Ravi Yasas
Use jar not war
- If you run mvn clean install in Spring Boot, you will get a fat jar file.
- It contains everything like dependencies, embedded web server... etc.
- You can just run java -jar jarFile in a JVM, the default is Tomcat embedded server or you can use Jetty.
- You don't need any web server or application server to run spring boot jars.
- Because spring boot will provide us a production-ready jar file with the embedded tomcat.
- If you need to run spring boot applications in existing web servers, you may have to create war instead of a jar.
- Spring Boot supports only Tomcat, Jetty, and Undertow as the embedded server