Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring MVC or Spring Boot [closed]

People also ask

Which is better Spring MVC or Spring boot?

Spring MVC helps to develop applications easily. Spring Boot helps to develop the applications easily and quickly with features like auto-configuration and starters. Spring Boot helps in reducing the development time as all the dependency-related task gets handled.

Is Spring MVC still used in 2021?

Yes. Whenever someone uses Spring Boot for creating RESTful web services, chances are they are using Spring MVC (part of Spring Web starter, see http://start.spring.io and search Web in dependencies) although Spring has also been offering another web framework, Spring WebFlux.

Is Spring MVC necessary before spring boot?

You need to learn Spring in order to have any concept of what Spring Boot is really doing for you.

Is Spring MVC in demand?

Trends clearly show that spring as a Java-based web framework is here to stay. This means that the demand for skilled spring developers will always be there. If you are a Java developer who is looking to add a few new skills to your repertoire, you should definitely think about spring.


My personal advice is to definitely use Spring Boot for many reasons.

  1. The first is that Boot is the "future of Spring". That means that with Boot you can benefit from many commitments of the Spring community. Most of the Spring projects today are completely integrated with Boot, even the community starts to develop many applications based on Boot. For example for managing and monitoring. I can suggest to see Spring Boot Admin

  2. With Spring Boot you can benefit from very nice and useful features such as actuator and remote shell for managing and monitoring, that improves your application with production ready features that are very useful.

  3. Very nice and powerful properties and configuration controls - you can configure your application with application.properties/yml and extend the boot in a very simple and impressive way, even the management in terms of overriding is very powerful.

  4. It is one of the first micro-service ready platforms, and in my opinion nowadays it is the best! Even if you don't build a micro-service project with boot you can benefit of using a modern approach in which you have a auto-consistent jar that can benefit from all the features that I described above or if you prefer you can impose the packaging as a classical war and deploy your war in any of the containers that you want.

  5. Use of an intelligent and convention over configuration approach that reduces the startup and configuration phase of your project significantly. In fact you have a set of starter Maven or Gradle dependencies that simplify the dependency management. Then with the auto-configuration characteristic you can benefit from a lot of standard configurations, that are introduced through the Conditional Configuration framework in Spring 4. You can override it with your specific configurations just defining your bean according with the convention that you can see in the auto-configure JAR of the Boot dependency. Remember that Spring is open-source and you can see the code. Also the documentation in my opinion is good.

  6. Spring initializer is a cool tool attainable at this link: https://start.spring.io/ is a very cool tool just to create your project in a very fast way.


I hope that this reflection can help you decide what is the best solution.


Spring Boot uses Spring MVC! It's just autoconfigured and ready to use when you import the spring-boot-starter-web jar. So you'd basically are talking about whether to use Spring Boot or manually setup your Spring Application...


You can definitely go for Spring Boot. We have already started using Spring Boot for building enterprise application. It has lot of advantages, listing few below here:

  1. Your project configuration will be pretty simple. No need to maintain XML file, all you need to know is how efficiently you can use application.properties file.

  2. Gives lot of default implementation, for instance if you need to send an email, it provides default implementation of JavaMailSender

  3. Spring Hibernate and JPA integration will be pretty simple.

Like this there are many, you can explore based on your needs.


You can use Spring MVC with spring boot as @kryger said, they are non exclusive between them, and the configuration will be easier, also I recommend you to use http://www.thymeleaf.org/ which is template framework. Working with that is like working with JSP but thymeleaf integrates seamlessly with HTML, so your code will look very clean and you can add a lot of useful features.


I think Spring Boot is more useful than the MVC, as it has many advantages and inbuilt features which make it more reliable than MVC. In Spring Boot most of the things are auto configured and there is no need of writing those xml as we do in the MVC, which can save time.

Spring Boot bundles a war file with server run-time like Tomcat. This allows easy distribution and deployment of web applications. As the industry is moving towards container based deployments, Spring Boot is useful in this context as well.

Spring MVC is web application framework. While you can do everything in Spring without Spring Boot, but Spring Boot helps you get things done faster.

Spring boot simplifies your Spring dependencies, no more version collisions, can be run straight from a command line without an application container, build more with less code - no need for XML, not even web.xml, auto-configuration, useful tools for running in production, database initialization, environment specific config files, collecting metrics.

Basics of Spring Boot can be found here