Java Reference
In-Depth Information
for(Book b: bookList){
System.out.println(b.getId()+"--"+b.getBookTitle());
}
}
}
In this section, you learned the key objectives of the Spring Framework, which aims to simplify the
complexity that trickles into any enterprise application via tight coupling, cross-cutting concerns,
and boilerplate code. In the next section, we will implement the web layer using the Web MVC
module of the Spring Framework.
Building Web Application with Spring Web MVC
In Chapter 1, Spring Web MVC provided the Model-View-Controller architecture and myriad of
components that together help you develop loosely coupled web applications built on the Spring
IoC container.
Spring Web MVC Architecture
Spring's Web MVC framework, like many other web MVC frameworks, is request-driven, designed
around a central servlet called DispatcherServlet that dispatches requests to controllers and
offers other functionality that facilitates the development of web applications. DispatcherServlet
implements one of the Java EE web-tier patterns, called Front Controller. As such,
DispatcherServlet acts as the front controller of the Spring MVC framework, and every web request
has to go through it so that it can control and administer the entire request-handling process. The
request-processing workflow of the Spring Web MVC DispatcherServlet is illustrated in Figure 5-6 .
Request
Handler Mapping
Request
Controller
Request
Controller
ModelAndView
Dispatcher
Servlet
View Name
View Resolver
View
Model
Response
View
Response
Figure 5-6. Request-processing workflow of the Spring Web MVC DispatcherServlet
 
 
Search WWH ::




Custom Search