Spring Boot: Difference between revisions
From My Limbic Wiki
(Page créée avec « Comparaison with Spring Boot and Spring https://www.springboottutorial.com/spring-boot-vs-spring-mvc-vs-spring =What's new= Come with: * Autoconfiguration ** Previously B... ») |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Scope= | |||
* Big environment wich is use to help us develop applications. | |||
* if Spring MVC need configuration ? Spring Boot does it. | |||
* Other jars needed to develop web applications ? there are starters allowing to easily build application | |||
* Monitoring, and developer friendly tools | |||
* '''Good integration with embeded servers: No need to develop a WAR file always, it is possible to develop a JAR and directly run it cause the Tomcat server is directly inside the JAR.''' | |||
Comparaison with Spring Boot and Spring | Comparaison with Spring Boot and Spring | ||
https://www.springboottutorial.com/spring-boot-vs-spring-mvc-vs-spring | https://www.springboottutorial.com/spring-boot-vs-spring-mvc-vs-spring | ||
Line 5: | Line 12: | ||
Come with: | Come with: | ||
* Autoconfiguration | * Autoconfiguration | ||
** Previously Bean, Resources, Servlet, View Resolver configuration | ** Previously ([[Spring_MVC]]) Bean, Resources, Servlet, View Resolver configuration | ||
* Starters (Spring boot starter web ...) | * Starters (Spring boot starter web ...) | ||
** Bring all the dependencis required to build web applications | ** Bring all the dependencis required to build web applications | ||
=Mock - Dependency Injection= | |||
<source lang="java"> | |||
@Component | |||
public class WelcomeService { | |||
//Bla Bla Bla | |||
} | |||
@RestController | |||
public class WelcomeController { | |||
@Autowired | |||
private WelcomeService service; | |||
@RequestMapping("/welcome") | |||
public String welcome() { | |||
return service.retrieveWelcomeMessage(); | |||
} | |||
} | |||
</source> | |||
=Spring Boot Starter Project Options= | =Spring Boot Starter Project Options= | ||
Line 22: | Line 49: | ||
* '''-cache''' - Enabling Spring Framework’s caching support | * '''-cache''' - Enabling Spring Framework’s caching support | ||
* '''-data-rest''' - Expose Simple REST Services using Spring Data REST | * '''-data-rest''' - Expose Simple REST Services using Spring Data REST | ||
===Technical Stuff=== | |||
'''spring-boot-starter-*''': | |||
* '''-actuator''' - To use advanced features like monitoring & tracing to your application out of the box | |||
* '''-undertow''', '''-jetty''', '''-tomcat''' To pick your specific choice of Embedded Servlet Container | |||
* '''-logging''' - For Logging using logback | |||
* '''-log4j2''' - Logging using Log4j2 |
Latest revision as of 19:59, 23 September 2019
Scope
- Big environment wich is use to help us develop applications.
- if Spring MVC need configuration ? Spring Boot does it.
- Other jars needed to develop web applications ? there are starters allowing to easily build application
- Monitoring, and developer friendly tools
- Good integration with embeded servers: No need to develop a WAR file always, it is possible to develop a JAR and directly run it cause the Tomcat server is directly inside the JAR.
Comparaison with Spring Boot and Spring https://www.springboottutorial.com/spring-boot-vs-spring-mvc-vs-spring
What's new
Come with:
- Autoconfiguration
- Previously (Spring_MVC) Bean, Resources, Servlet, View Resolver configuration
- Starters (Spring boot starter web ...)
- Bring all the dependencis required to build web applications
Mock - Dependency Injection
<source lang="java">
@Component public class WelcomeService { //Bla Bla Bla } @RestController public class WelcomeController { @Autowired private WelcomeService service; @RequestMapping("/welcome") public String welcome() { return service.retrieveWelcomeMessage(); } }
</source>
Spring Boot Starter Project Options
Dependencies to use in pom.xml available to start faster a spring boot project.
spring-boot-starter-*:
- -web-services - SOAP Web Services
- -web - Web & RESTful applications
- -test - Unit testing and Integration Testing
- -jdbc - Traditional JDBC
- -hateoas - Add HATEOAS features to your services
- -security - Authentication and Authorization using Spring Security
- -data-jpa - Spring Data JPA with Hibernate
- -cache - Enabling Spring Framework’s caching support
- -data-rest - Expose Simple REST Services using Spring Data REST
Technical Stuff
spring-boot-starter-*:
- -actuator - To use advanced features like monitoring & tracing to your application out of the box
- -undertow, -jetty, -tomcat To pick your specific choice of Embedded Servlet Container
- -logging - For Logging using logback
- -log4j2 - Logging using Log4j2