What is spring boot ?
Spring boot is used to develop stand alone and production ready
application which just runs. It takes opinionated view to auto configure the
resources based on the information it finds on classpath. Example: It sets up a
JPA Entity Manager Factory if it finds JPA implementation on classpath. It sets
up default Spring MVC environmemt if it finds Spring MVC on classpath.
What are the advantages of Spring
boot ?
It avoids writing boilerplate code like xml, configuration files etc
It auto configures the enviroment based on the information at classpath.
Example: It sets up a JPA EntityManager Factory if it finds JPA implementation
on classpath. It sets up default Spring MVC environmemt if it finds Spring MVC
on classpath.
Provide production-ready features such as metrics, health checks and
externalized configuration
It comes with embedded servlet container like Tomcat, jetty
It provides support for metrics, health check of the application
What is the default packaging of spring boot application?
By default spring boot is configured to
generate runnable JAR application
How
can you change the runnable JAR of spring boot appliation to deployable
WAR file in spring boot?
At first extend the main class to
SpringBootServletInitializer class and overide the configure method. This
makes spring framework servlet3.0 container support and configure the
application when it is launched by the container.
Secondly, change the packaging from .jar to .war in pom.xml of maven or
build.gradle in gradle
How to configure logging in spring
boot application?
Spring boot uses Logback for logging mechanism. If you added the
depepndency spring-boot-starter-web for web application then it added the
logback mechanism automatically
No comments:
Post a Comment