Before the advent of Spring Boot, developers had to manually configure various components of a Spring application. This process involved writing extensive XML or Java-based configuration code for even the simplest setups. While this provided flexibility, it also made development cumbersome, error-prone, and time-consuming. This blog delves into practical, industry-focused examples to illustrate how developers managed configurations manually before Spring Boot simplified the process.
1. Setting Up a Spring Web Application
Before Spring Boot, creating a web application required defining servlets, view resolvers, and more manually.
XML Configuration Example
web.xml
(Servlet Configuration):
Java
<web-app>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
dispatcher-servlet.xml
(Spring MVC Configuration):
Java