SlideShare ist ein Scribd-Unternehmen logo
1 von 36
MVC ,[object Object],[object Object],[object Object],[object Object]
What are design patterns? ,[object Object],[object Object],[object Object]
About MVC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Front controller pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Problem domain ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is MVC? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A variation of MVC architecture
Model Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
View Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Controller layer ,[object Object],[object Object]
Advantage of MVC ,[object Object],[object Object],[object Object],[object Object]
Technology and Framework used in MVC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is a Servlet? ,[object Object],[object Object]
Life of a Servlet Web Browser Web Server Java Servlet Database
Java Server Pages ,[object Object],[object Object],[object Object],[object Object]
Servlets v. JSP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType(&quot;text/html&quot;); PrintWriter out = res.getWriter(); out.println(&quot;<HTML>&quot;); out.println(&quot;<HEAD><TITLE>Hello World</TITLE></HEAD>&quot;); out.println(&quot;<BODY>&quot;); out.println(&quot;<BIG>Hello World</BIG>&quot;); out.println(&quot;</BODY></HTML>&quot;); } } A Java Servlet : Looks like a regular  Java program
<html>  <head> <title>Hello, World JSP Example</title> </head>  <body> <h2> Hello, World!  The current time in milliseconds is  <%= System.currentTimeMillis() %>  </h2> </body> </html>  A JSP Page : Looks like a regular  HTML page. Embedded Java command to print current time.
Java Beans ,[object Object],[object Object]
Java Beans ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
An example Example: The sample application will have a basic opening page that links to an employee search page.From the Employee search page,user can search for employees by name or social security number.After executing the search,the search page will be redisplayed with a list of employees that match the search criteria.
model 2 architecture
Struts ,[object Object],[object Object],[object Object],[object Object],[object Object]
Struts and MVC mapping ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basic component of Struts ,[object Object],[object Object],[object Object],[object Object]
View Layer in Struts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Form Beans ,[object Object],[object Object],[object Object]
JSP Tag libraries ,[object Object],[object Object],[object Object],[object Object],[object Object]
Resource Bundles ,[object Object],[object Object],[object Object],[object Object]
Controller Layer in Struts ,[object Object],[object Object],[object Object],[object Object],[object Object]
Struts Model interface as  action class ,[object Object],[object Object],[object Object],[object Object]
Browser ActionServlet RequestProcessor Action Model View Application execution with Struts Framework
Flow of execution ,[object Object],[object Object],[object Object]
Continued…….. ,[object Object],[object Object],[object Object]
example Browser 2.Populate 1.Request 3. Delegate JSP Database/ Services 2. populate 5.Forward 4.inteface Response ActionServlet Action Action Action SearchForm SearchForm SearchForm Model  class Model class Model class
References ,[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Jsp with mvc
Jsp with mvcJsp with mvc
Jsp with mvc
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
MVC Seminar Presantation
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar Presantation
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails Developers
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
MVC
MVCMVC
MVC
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
Design Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMDesign Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVM
 
Mvc fundamental
Mvc fundamentalMvc fundamental
Mvc fundamental
 
Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01
 
Why MVC?
Why MVC?Why MVC?
Why MVC?
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
Why Use MVC?
Why Use MVC?Why Use MVC?
Why Use MVC?
 

Andere mochten auch

Practical Inversion Of Control
Practical Inversion Of ControlPractical Inversion Of Control
Practical Inversion Of Controlmhinze
 
Inversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionInversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionAndriy Buday
 
Dependency Injection & IoC
Dependency Injection & IoCDependency Injection & IoC
Dependency Injection & IoCDennis Loktionov
 
Produtividade na criação de websites com ASP.NET MVC
Produtividade na criação de websites com ASP.NET MVCProdutividade na criação de websites com ASP.NET MVC
Produtividade na criação de websites com ASP.NET MVCWaldyr Felix
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code FirstJames Johnson
 
Dependency Injection Inversion Of Control And Unity
Dependency Injection Inversion Of Control And UnityDependency Injection Inversion Of Control And Unity
Dependency Injection Inversion Of Control And Unityrainynovember12
 
20080531 Intro To Dependency Injection & Inversion Of Control
20080531 Intro To Dependency Injection & Inversion Of Control20080531 Intro To Dependency Injection & Inversion Of Control
20080531 Intro To Dependency Injection & Inversion Of Controldonnfelker
 
The Spring Framework: A brief introduction to Inversion of Control
The Spring Framework:A brief introduction toInversion of ControlThe Spring Framework:A brief introduction toInversion of Control
The Spring Framework: A brief introduction to Inversion of ControlVisualBee.com
 
Inversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionInversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionDinesh Sharma
 
Créer une application web en asp.net mvc 2
Créer une application web en asp.net mvc 2Créer une application web en asp.net mvc 2
Créer une application web en asp.net mvc 2Novencia Groupe
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented ProgrammingAnumod Kumar
 
Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2billdigman
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
J2EE and layered architecture
J2EE and layered architectureJ2EE and layered architecture
J2EE and layered architectureSuman Behara
 

Andere mochten auch (15)

Practical Inversion Of Control
Practical Inversion Of ControlPractical Inversion Of Control
Practical Inversion Of Control
 
Inversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionInversion of Control and Dependency Injection
Inversion of Control and Dependency Injection
 
Agile and Frameworks
Agile and FrameworksAgile and Frameworks
Agile and Frameworks
 
Dependency Injection & IoC
Dependency Injection & IoCDependency Injection & IoC
Dependency Injection & IoC
 
Produtividade na criação de websites com ASP.NET MVC
Produtividade na criação de websites com ASP.NET MVCProdutividade na criação de websites com ASP.NET MVC
Produtividade na criação de websites com ASP.NET MVC
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
 
Dependency Injection Inversion Of Control And Unity
Dependency Injection Inversion Of Control And UnityDependency Injection Inversion Of Control And Unity
Dependency Injection Inversion Of Control And Unity
 
20080531 Intro To Dependency Injection & Inversion Of Control
20080531 Intro To Dependency Injection & Inversion Of Control20080531 Intro To Dependency Injection & Inversion Of Control
20080531 Intro To Dependency Injection & Inversion Of Control
 
The Spring Framework: A brief introduction to Inversion of Control
The Spring Framework:A brief introduction toInversion of ControlThe Spring Framework:A brief introduction toInversion of Control
The Spring Framework: A brief introduction to Inversion of Control
 
Inversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionInversion of Control and Dependency Injection
Inversion of Control and Dependency Injection
 
Créer une application web en asp.net mvc 2
Créer une application web en asp.net mvc 2Créer une application web en asp.net mvc 2
Créer une application web en asp.net mvc 2
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
J2EE and layered architecture
J2EE and layered architectureJ2EE and layered architecture
J2EE and layered architecture
 

Ähnlich wie MVC

Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) pptmrsurwar
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts frameworks4al_com
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083Divyam Pateriya
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overviewskill-guru
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issuesPrashant Seth
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVCJohn Lewis
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892Tuna Tore
 

Ähnlich wie MVC (20)

Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083
 
Struts N E W
Struts N E WStruts N E W
Struts N E W
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Month 2 report
Month 2 reportMonth 2 report
Month 2 report
 
Struts
StrutsStruts
Struts
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
 
Session 1
Session 1Session 1
Session 1
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issues
 
Struts ppt 1
Struts ppt 1Struts ppt 1
Struts ppt 1
 
Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
Mvc Brief Overview
Mvc Brief OverviewMvc Brief Overview
Mvc Brief Overview
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
 

MVC

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. A variation of MVC architecture
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. Life of a Servlet Web Browser Web Server Java Servlet Database
  • 15.
  • 16.
  • 17. import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType(&quot;text/html&quot;); PrintWriter out = res.getWriter(); out.println(&quot;<HTML>&quot;); out.println(&quot;<HEAD><TITLE>Hello World</TITLE></HEAD>&quot;); out.println(&quot;<BODY>&quot;); out.println(&quot;<BIG>Hello World</BIG>&quot;); out.println(&quot;</BODY></HTML>&quot;); } } A Java Servlet : Looks like a regular Java program
  • 18. <html> <head> <title>Hello, World JSP Example</title> </head> <body> <h2> Hello, World! The current time in milliseconds is <%= System.currentTimeMillis() %> </h2> </body> </html> A JSP Page : Looks like a regular HTML page. Embedded Java command to print current time.
  • 19.
  • 20.
  • 21. An example Example: The sample application will have a basic opening page that links to an employee search page.From the Employee search page,user can search for employees by name or social security number.After executing the search,the search page will be redisplayed with a list of employees that match the search criteria.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. Browser ActionServlet RequestProcessor Action Model View Application execution with Struts Framework
  • 33.
  • 34.
  • 35. example Browser 2.Populate 1.Request 3. Delegate JSP Database/ Services 2. populate 5.Forward 4.inteface Response ActionServlet Action Action Action SearchForm SearchForm SearchForm Model class Model class Model class
  • 36.