Professional Documents
Culture Documents
Introduction
Spring MVC
peter.maas@finalist.com ☄ maas-frensch.com/peter/
Spring MVC
Introduction to Spring MVC & Web Flow
Spring MVC
Spring
Spring MVC
Why Spring (I)
Key reasons
Spring MVC
Why Spring (II)
Spring MVC
Spring basics
Equals
myService.setMyRepository(myRepository);
myService.setMaxResults(10);
Spring MVC
Spring basics (II)
Equals
Spring MVC
Demo I
Spring MVC
Typical SpringMVC Architecture
Business logic
User Interface
Web
Domain
Model Connections to exernal
systems (database,
Services
webservices)
Integration
Spring MVC
MVC
Controller
request
Model
Actor
response
View
Spring MVC
Controller
Spring MVC
Controller Interface
/**
* Process the request and return a
* ModelAndView object which the DispatcherServlet
* will render.
*/
ModelAndView handleRequest(
HttpServletRequest request,
HttpServletResponse response) throws Exception;
Spring MVC
Controllers
«interface»
UrlFilenameViewController
Controller
BaseCommandController AbstractCommandController
Spring MVC
Model
M o d e l ~ T h e d o m a i n - s p e c i fi c
representation of the information on
which the application operates.
List<SearchResult> results =
new ArrayList<SearchResult>();
model.addObject("searchResults", results);
List<SearchResult> r =
(List<SearchResult>)model.get("searchResults");
Spring MVC
View
Spring MVC
Views
view
AbstractXsltView
Spring MVC
Handlers
or
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/hello" value-ref="helloworldController" />
</map>
</property>
</bean>
Spring MVC
Demo II
Spring MVC
Demo II ~ Classpath essentials
spring-webmvc.jar
commons-logging.jar
logkit.jar
spring-beans.jar
spring-context.jar
aopalliance.jar
spring-core.jar
spring-support.jar
spring-web.jar
log4j.jar
Spring MVC
More to come ~ Complex forms,
Binding, Validation, Interceptors,
Inter nationalisation, Webflow,
Ajax ...
Spring MVC
internet
Firewall &
Loadbalancer
REST (https)
signon.vpro.nl
SOAP (http)
XML belbios
JDBC JDBC LDAP
MMBase
scp
Spring MVC