SlideShare a Scribd company logo
Design & Development
of Web Applications
using Spring MVC
by Naresh Chintalcheru
Spring MVC
Another Web MVC Framework?
Spring MVC
Another Web MVC Framework?
After learning Struts, JSF, DDUI …….
…………….. now Spring MVC ?
Spring MVC
● Benefit of using a Web Framework
● Removes the need of boilerplate code
● Gather HTTP Request Parameters
● Validation & Conversions
● Update the Model
● Standard code level design for multiple
applications in an enterprise
● Navigation Flow
● Validations
Spring MVC
● Benefit of using a Web Framework
● No Web Application Component Design
● Use Web Framework as Design Templates
and plugin the View, Model and Controllers
Spring MVC
● Benefit of using a Web Framework
● Speed up the development
Spring MVC
Web MVC Frameworks
● Struts
● JSF
● Wicket
● DDUI
● Spring MVC
Spring MVC
Presentation Layer Frameworks
● Web MVC Framework
● Template Framework
● View Technologies
● UI Widget Framework
Spring MVC
Template Frameworks
● Tiles
● Facelets
● SiteMesh
View Technologies
● JSP
● XHTML
● XSLT
UI Widget Frameworks
● JQuery
● DOJO
● SFX
Spring MVC
Why Spring MVC Framework?
Spring MVC
Spring MVC is a action-based or request-based
framework similar to Struts.
JSF is a component-based framework.
Spring MVC
Spring MVC
Spring MVC
Spring MVC vs JSF
● JSF is part of JEE Specification
● JSF is based on component architecture and
has learning curve
● Limited HTTP GET method support in JSF
● REST Web Services Support in Spring MVC.
Spring MVC
Spring MVC vs Struts
● Struts forces concrete Inheritance of
Action/ActionForm, taking away single shot of
Inheritance in Java.
● Spring MVC based on Interfaces and
Annotations.
● Spring MVC is truly view-agnostic. Many
options in View Technologies.
● Use Spring IoC Container from Presentation
Tier to Integration Tier.
Spring MVC
Spring MVC is only one module in the Spring Framework
Spring Framework Fundamentals
Spring Framework Fundamentals
Spring Framework Fundamentals
What is Spring Framework ?
● Spring Framework is …..
● Open Source Meta Framework
● Provides frameworks and container
● Simplify the development
Spring Framework Fundamentals
Spring framework is a Layered Architecture
Choose the modules needed and eliminate other
modules
All modules are built on the top of its core
container
Spring Framework
Benefits:
● Light Weight
● Promotes good OO design
● Container Agnostic Framework : Insulates the
application from its hosting container.
Spring Framework Fundamentals
Spring Has Two Web Frameworks
● Spring MVC
● Spring Web Flow
Spring Framework Fundamentals
Spring Framework Web Flow
● Secondary Page Flow logic framework
● Can be used with Spring MVC, JSF and
Struts.
Spring Framework Fundamentals
Spring MVC Request Flow ….
Spring MVC
Spring MVC
Spring MVC
Spring MVC
Spring MVC
Front Controller Design Pattern:
● DispatcherServlet is the Front Controller handles Client
Requests.
● ActionServlet in Struts
● FacesServlet in JSF
● AppServlet in DDUI
Spring MVC
Controller Design Pattern in MVC:
● Controllers are components that are being called by the
Dispatcher Servlet for performing page level logic and
delegate to Service Objects.
● Action Classes in Struts
● Managed Beans & Backed Beans in JSF
● PageProcessor in DDUI
Spring MVC
View Resolver & Navigation Logic:
● Resolves view names to views. Resolves navigation
logic from spring-mvc.xml
● Struts-config.xml in Struts
● Jsf-config.xml in JSF
Spring MVC
Developing App using Spring MVC:
● Step 1: web.xml : Front Controller
<web-app version="2.4">
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.*</url-pattern>
</servlet-mapping>
</web-app>
Spring MVC
Developing App using Spring MVC:
● Step 2: web.xml : ApplicationContext
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-mvc.xml</param-value>
</context-param>
Spring MVC
Developing App using Spring MVC:
● Step 3: spring-mvc.xml : Component Scan
<beans>
<context:component-scan base-package=“com.sf.web"/>
</beans>
Spring MVC
Developing App using Spring MVC:
● Step 4: Controller Classes
@Controller
public class EmployeeController {
@Autowired
private final EmployeeSO employeeSO;
@RequestMapping("/emplist")
public String empHandler(Model model) {
List empList = employeeSO.getAllEmp();
model.addAttribute(“empList”, empList);
return “ListEmpPage” ;
}
}
Spring MVC
Bean Validation Framework JSR-303:
public class Employee {
@NotNull
@Pattern(regexp = "[a-z-A-Z]*")
private String firstName;
@Size(min=2, max=15)
private String lastName;
@Past
private Date birthDate;
@Email (message=“Invalid Email “)
private String email;
Spring MVC
REST Web Services:
http://localhost:8080/SpringMVC/employee/John
@Controller @RequestMapping("/employee")
public class EmployeeController {
@RequestMapping( value="/{name}“ )
public String getEmp(@PathVariable String name, ModelMap
model) {
model.addAttribute(“emp", name);
return “EmpListPage";
}
}
Spring MVC
Question & Answers

More Related Content

PDF
SpringMVC
PDF
Spring MVC
PDF
Spring MVC Framework
PDF
Spring Framework - MVC
PPTX
Next stop: Spring 4
PPTX
Spring MVC Architecture Tutorial
PDF
3rd Generation Web Application Platforms
PDF
Spring Framework - Core
SpringMVC
Spring MVC
Spring MVC Framework
Spring Framework - MVC
Next stop: Spring 4
Spring MVC Architecture Tutorial
3rd Generation Web Application Platforms
Spring Framework - Core

What's hot (19)

PDF
PUC SE Day 2019 - SpringBoot
PPTX
Spring MVC framework
PDF
Modularize JavaScript with RequireJS
PPTX
Reactjs Introduction - Virtual DOM
PPTX
Advance java Online Training in Hyderabad
PDF
Spring Framework
PDF
Java EE 8 Web Frameworks: A Look at JSF vs MVC
PPTX
Introduction to Spring Boot
PDF
Web sockets in Angular
PPSX
Struts 2 - Introduction
PPTX
React js Demo Explanation
PPTX
The Past Year in Spring for Apache Geode
PPTX
Introduction to Spring Framework
PPTX
Spring MVC 5 & Hibernate 5 Integration
PPTX
J servlets
PPT
MVC Demystified: Essence of Ruby on Rails
PPT
Struts,Jsp,Servlet
PDF
Require.JS
PDF
Introduction to Spring Framework
PUC SE Day 2019 - SpringBoot
Spring MVC framework
Modularize JavaScript with RequireJS
Reactjs Introduction - Virtual DOM
Advance java Online Training in Hyderabad
Spring Framework
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Introduction to Spring Boot
Web sockets in Angular
Struts 2 - Introduction
React js Demo Explanation
The Past Year in Spring for Apache Geode
Introduction to Spring Framework
Spring MVC 5 & Hibernate 5 Integration
J servlets
MVC Demystified: Essence of Ruby on Rails
Struts,Jsp,Servlet
Require.JS
Introduction to Spring Framework
Ad

Viewers also liked (20)

PDF
SpringMVC
PPTX
Skillwise-Spring framework 1
PDF
Spring Framework - III
PDF
Building Web Application Using Spring Framework
PDF
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
PDF
Modern Architectures with Spring and JavaScript
PDF
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
PPTX
Introduction to spring boot
ODP
Java Spring MVC Framework with AngularJS by Google and HTML5
PPT
Building a Scalable Architecture for web apps
PDF
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
PDF
Hr coverage directi 2012
PPT
Web Application Development Fundamentals
PPTX
Web application architecture
PDF
Web Design & Development Trends Presentation
PPTX
Final Year Project Presentation
DOC
A project report on comparative study of mutual funds in india
PPTX
Introduction to Web Architecture
PDF
Fundamentals of Web Development For Non-Developers
PDF
Architecture of a Modern Web App
SpringMVC
Skillwise-Spring framework 1
Spring Framework - III
Building Web Application Using Spring Framework
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
Modern Architectures with Spring and JavaScript
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Introduction to spring boot
Java Spring MVC Framework with AngularJS by Google and HTML5
Building a Scalable Architecture for web apps
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Hr coverage directi 2012
Web Application Development Fundamentals
Web application architecture
Web Design & Development Trends Presentation
Final Year Project Presentation
A project report on comparative study of mutual funds in india
Introduction to Web Architecture
Fundamentals of Web Development For Non-Developers
Architecture of a Modern Web App
Ad

Similar to Design & Development of Web Applications using SpringMVC (20)

PPTX
Technoligent providing custom ASP.NET MVC development services
PPTX
Introduction to mvc architecture
PPTX
Spring mvc
PPTX
Session 46 - Spring - Part 4 - Spring MVC
DOCX
Month 2 report
PPSX
Spring - Part 4 - Spring MVC
PPTX
Ios models
PPTX
Aspnet mvc
PPTX
Mvc 4 0_jayant_jindal_28082010
PDF
Spring Framework-II
PDF
MVC architecture
PPTX
MVC & backbone.js
ODP
Mvc
PPTX
Web tier-framework-mvc
PPTX
Spring Framework
PPT
MVC From Beginner to Advance in Indian Style by - Indiandotnet
PPTX
Sitecore MVC: What it is and why it's important
PPT
Asp.net mvc
PDF
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 3 ...
PPTX
Which is better asp.net mvc vs asp.net
Technoligent providing custom ASP.NET MVC development services
Introduction to mvc architecture
Spring mvc
Session 46 - Spring - Part 4 - Spring MVC
Month 2 report
Spring - Part 4 - Spring MVC
Ios models
Aspnet mvc
Mvc 4 0_jayant_jindal_28082010
Spring Framework-II
MVC architecture
MVC & backbone.js
Mvc
Web tier-framework-mvc
Spring Framework
MVC From Beginner to Advance in Indian Style by - Indiandotnet
Sitecore MVC: What it is and why it's important
Asp.net mvc
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 3 ...
Which is better asp.net mvc vs asp.net

More from Naresh Chintalcheru (15)

PDF
Cars.com Journey to AWS Cloud
PDF
Bimodal IT for Speed and Innovation
PDF
Reactive systems
PDF
Introduction to Node.js Platform
PDF
Asynchronous Processing in Java/JEE/Spring
PDF
Problems opening SOA to the Online Web Applications
PDF
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
PDF
Java7 New Features and Code Examples
PDF
Big Trends in Big Data
PDF
Design & Develop Batch Applications in Java/JEE
PDF
Building Next Generation Real-Time Web Applications using Websockets
PDF
Mule ESB Fundamentals
PDF
Automation Testing using Selenium
PDF
Android Platform Architecture
PDF
Object-Oriented Polymorphism Unleashed
Cars.com Journey to AWS Cloud
Bimodal IT for Speed and Innovation
Reactive systems
Introduction to Node.js Platform
Asynchronous Processing in Java/JEE/Spring
Problems opening SOA to the Online Web Applications
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
Java7 New Features and Code Examples
Big Trends in Big Data
Design & Develop Batch Applications in Java/JEE
Building Next Generation Real-Time Web Applications using Websockets
Mule ESB Fundamentals
Automation Testing using Selenium
Android Platform Architecture
Object-Oriented Polymorphism Unleashed

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
A Presentation on Artificial Intelligence
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation_ Review paper, used for researhc scholars
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Advanced methodologies resolving dimensionality complications for autism neur...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
A Presentation on Artificial Intelligence
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
MYSQL Presentation for SQL database connectivity
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

Design & Development of Web Applications using SpringMVC

  • 1. Design & Development of Web Applications using Spring MVC by Naresh Chintalcheru
  • 2. Spring MVC Another Web MVC Framework?
  • 3. Spring MVC Another Web MVC Framework? After learning Struts, JSF, DDUI ……. …………….. now Spring MVC ?
  • 4. Spring MVC ● Benefit of using a Web Framework ● Removes the need of boilerplate code ● Gather HTTP Request Parameters ● Validation & Conversions ● Update the Model ● Standard code level design for multiple applications in an enterprise ● Navigation Flow ● Validations
  • 5. Spring MVC ● Benefit of using a Web Framework ● No Web Application Component Design ● Use Web Framework as Design Templates and plugin the View, Model and Controllers
  • 6. Spring MVC ● Benefit of using a Web Framework ● Speed up the development
  • 7. Spring MVC Web MVC Frameworks ● Struts ● JSF ● Wicket ● DDUI ● Spring MVC
  • 8. Spring MVC Presentation Layer Frameworks ● Web MVC Framework ● Template Framework ● View Technologies ● UI Widget Framework
  • 9. Spring MVC Template Frameworks ● Tiles ● Facelets ● SiteMesh View Technologies ● JSP ● XHTML ● XSLT UI Widget Frameworks ● JQuery ● DOJO ● SFX
  • 10. Spring MVC Why Spring MVC Framework?
  • 11. Spring MVC Spring MVC is a action-based or request-based framework similar to Struts. JSF is a component-based framework.
  • 14. Spring MVC Spring MVC vs JSF ● JSF is part of JEE Specification ● JSF is based on component architecture and has learning curve ● Limited HTTP GET method support in JSF ● REST Web Services Support in Spring MVC.
  • 15. Spring MVC Spring MVC vs Struts ● Struts forces concrete Inheritance of Action/ActionForm, taking away single shot of Inheritance in Java. ● Spring MVC based on Interfaces and Annotations. ● Spring MVC is truly view-agnostic. Many options in View Technologies. ● Use Spring IoC Container from Presentation Tier to Integration Tier.
  • 16. Spring MVC Spring MVC is only one module in the Spring Framework
  • 19. Spring Framework Fundamentals What is Spring Framework ? ● Spring Framework is ….. ● Open Source Meta Framework ● Provides frameworks and container ● Simplify the development
  • 20. Spring Framework Fundamentals Spring framework is a Layered Architecture Choose the modules needed and eliminate other modules All modules are built on the top of its core container
  • 21. Spring Framework Benefits: ● Light Weight ● Promotes good OO design ● Container Agnostic Framework : Insulates the application from its hosting container.
  • 22. Spring Framework Fundamentals Spring Has Two Web Frameworks ● Spring MVC ● Spring Web Flow
  • 23. Spring Framework Fundamentals Spring Framework Web Flow ● Secondary Page Flow logic framework ● Can be used with Spring MVC, JSF and Struts.
  • 24. Spring Framework Fundamentals Spring MVC Request Flow ….
  • 27. Spring MVC Front Controller Design Pattern: ● DispatcherServlet is the Front Controller handles Client Requests. ● ActionServlet in Struts ● FacesServlet in JSF ● AppServlet in DDUI
  • 28. Spring MVC Controller Design Pattern in MVC: ● Controllers are components that are being called by the Dispatcher Servlet for performing page level logic and delegate to Service Objects. ● Action Classes in Struts ● Managed Beans & Backed Beans in JSF ● PageProcessor in DDUI
  • 29. Spring MVC View Resolver & Navigation Logic: ● Resolves view names to views. Resolves navigation logic from spring-mvc.xml ● Struts-config.xml in Struts ● Jsf-config.xml in JSF
  • 30. Spring MVC Developing App using Spring MVC: ● Step 1: web.xml : Front Controller <web-app version="2.4"> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>*.*</url-pattern> </servlet-mapping> </web-app>
  • 31. Spring MVC Developing App using Spring MVC: ● Step 2: web.xml : ApplicationContext <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring-mvc.xml</param-value> </context-param>
  • 32. Spring MVC Developing App using Spring MVC: ● Step 3: spring-mvc.xml : Component Scan <beans> <context:component-scan base-package=“com.sf.web"/> </beans>
  • 33. Spring MVC Developing App using Spring MVC: ● Step 4: Controller Classes @Controller public class EmployeeController { @Autowired private final EmployeeSO employeeSO; @RequestMapping("/emplist") public String empHandler(Model model) { List empList = employeeSO.getAllEmp(); model.addAttribute(“empList”, empList); return “ListEmpPage” ; } }
  • 34. Spring MVC Bean Validation Framework JSR-303: public class Employee { @NotNull @Pattern(regexp = "[a-z-A-Z]*") private String firstName; @Size(min=2, max=15) private String lastName; @Past private Date birthDate; @Email (message=“Invalid Email “) private String email;
  • 35. Spring MVC REST Web Services: http://localhost:8080/SpringMVC/employee/John @Controller @RequestMapping("/employee") public class EmployeeController { @RequestMapping( value="/{name}“ ) public String getEmp(@PathVariable String name, ModelMap model) { model.addAttribute(“emp", name); return “EmpListPage"; } }