One of the best things to do to understand the beauty of Spring Boot is to understand how things were
done before Spring Boot. In this step, we'll look at one of the projects which we developed in our Spring MVC
course. Before we start with any project, we need to decide what frameworks and dependencies to use.
This was a web project, so we would want to use Spring MVC and things like that.
So we needed to make decisions on what frameworks and what version of them to use.
We needed to decide, I would want to use Spring MVC and Spring security web, Spring security config.
I would want to use Jackson databind because I want to do some binding and validation.
I would want to use JSTL and I would want to use Hibernate validator and also for logging I would
want to add in log4j. We had to decide what dependencies to add in to our projects.
Not only that, we needed to decide the versions of them as well.
Sometimes this 5.0.2.FINAL version might not be compatible with some other version of
Spring MVC.
So you needed to decide what are the comparable versions and start using them. Choosing the frameworks
to use and which version to use is a major decision that we needed to make when we were not using Spring Boot.
We needed to implement default exception handling.
You can see that here, we are just implementing simple default exception handling and we needed to create
a complete Spring configuration file.
We needed to define the component scan and then we would need to configure a view resolver to redirect the views
to a JSP. To implement internationalization,
We needed to implement a message source and also a locale resolver and in addition to that we needed
to configure our web.xml as well.
We needed to configure the dispatcher servlet in web.xml so that it can handle all the requests and
act as a front controller.
We needed to configure the contex configuration location in here and we also needed to configure the
Spring security. We needed to configure the filter for it and make sure that it intercepts all the request.
There is a lot of work that you would need to do to get a simple web application up and running. We configured
dependencies, dependency version, Spring configuration, configuration for internationalization, logging
and a lot of other stuff. All these stuff which we looked at in this specific step is the kind of stuff
which you don't need to do with Spring Boot. Spring Boot would automatically provide all that stuff for
you, so that you can really concentrate on developing your business logic.
All the infrastructure would come free for you.
The idea behind this step was to give you an idea of the world before Spring Boot. If we directly jump into
spring boot,
You might not really appreciate the value that Spring Boot provides. All the stuff which we looked at in
this specific example would be replaced by a simple starter project called Spring Boot startup web.
In combination with Spring Boot starter security.
Just the combination of these two starters would eliminate the need for a lot of configuration that
we looked at this specific step. We will look at those starters and a lot more about spring boot in
the subsequent steps.
Until the next step, bye-bye.