SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
Spring MVC
Introduction




               Spring MVC
peter.maas@finalist.com ☄ maas-frensch.com/peter/




Peter Maas ~ Works at Finalist IT
Group. 70% Developer, 20%
Architect and 10% CTO Board.
Techniques used daily include Java/
JEE, Spring, Hiber nate, JSP.
Passionate about scripting language
for the JVM like Groovy and JRuby.




                                             Spring MVC
Introduction to Spring MVC & Web Flow




                      Spring MVC
Spring




Spring ~ A Layered Java/JEE
application framework. The most
complete lightweight container,
providing centralized, automated
configuration and wiring of your
application objects.




                                   Spring MVC
Why Spring (I)


Key reasons

To provide a non-invasive programming model. As far as
possible, application code should be decoupled from the
framework.

To provide a superior solution to in-house infrastructure,
so that developers can focus on delivering business value
rather than solving generic problems.

To make developing enterprise applications as simple as
possible, but enhancing, rather than sacrificing, power.



                                                     Spring MVC
Why Spring (II)




Spring MVC
Spring basics




<bean id=quot;myRespositoryquot; class=quot;com.finalist.MyRepositoryImplquot;/>
<bean id=quot;myServicequot; class=quot;com.finalist.MyServiceImplquot;>
 <property name=quot;maxResultsquot; value=quot;10quot;/>
 <property name=quot;myRespositoryquot; ref=quot;myRespositoryquot;/>
</bean>

Equals

myRepository = new MyRepositoryImpl();
myService = new MyServiceImpl();

myService.setMyRepository(myRepository);
myService.setMaxResults(10);




                                                           Spring MVC
Spring basics (II)




<bean id=quot;myRespositoryquot; class=quot;com.finalist.MyRepositoryImplquot;/>
<bean id=quot;myServicequot; class=quot;com.finalist.MyServiceImplquot;>
 <constructor-arg index=quot;0quot; value=quot;10quot;/>
 <constructor-arg index=quot;1quot; ref=quot;myRespositoryquot;/>
</bean>

Equals

myRepository = new MyRepositoryImpl();
myService = new MyServiceImpl(10, myRepository);




                                                           Spring MVC
Demo I




Demo I ~ Basics of Spring




                            Spring MVC
Typical SpringMVC Architecture


Spring MVC territory




                                                      Business logic
                       User Interface



                           Web
             Domain
                                                  Connections to exernal
              Model
                                                   systems (database,
                         Services
                                                      webservices)



                        Integration




                                                         Spring MVC
MVC




                   Controller


        request



                                Model


Actor
        response

                     View




                                        Spring MVC
Controller




Controller ~ Controllers interpret
user input and transform such input
into a sensible model which will be
represented to the user by the view.




                                       Spring MVC
Controller Interface




                                                           If you find yourself
                                                            implementing the
                                                           controller interface
                                                          you're probable doing
public interface Controller {                              stuff the hard way!

    /**
     * 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




ParameterizableViewController                               MultiActionController
                                   AbstractController




                                BaseCommandController    AbstractCommandController




    SimpleFormController        AbstractFormController   AbstractWizardFormController




                                                                          Spring MVC
Model




Model ~ The domain-specific
representation of the information on
which the application operates.
List<SearchResult> results =
  new ArrayList<SearchResult>();

model.addObject(quot;searchResultsquot;, results);

List<SearchResult> r =
 (List<SearchResult>)model.get(quot;searchResultsquot;);




                                                   Spring MVC
View




View ~ Renders the model into a
for m suitable for interaction,
typically a user interface element.
Multiple views can exist for a single
model for different purposes.




                                        Spring MVC
Views
                        view




                                         RedirectView           JstlView
AbstractExcelView    AbstractView




                                      InternalResourceView      TilesView   TilesJstlView
AbstractPDFView
                     AbstractUrlB
                      asedView



                                                                  ...
AbstractJExcelView                  AbstractJasperReportsView




                                                                  ...
AbstractExcelView                     AbstractTemplateView




 AbstractXsltView




                                                                               Spring MVC
Handlers




Handlers ~ map incoming web requests to appropriate handlers.
<bean id=quot;handlerMappingquot;
    class=quot;org.springframework.web.servlet.handler.BeanNameUrlHandlerMappingquot; />

or

<bean id=quot;urlMappingquot;
  class=quot;org.springframework.web.servlet.handler.SimpleUrlHandlerMappingquot;>
  <property name=quot;urlMapquot;>
    <map>
       <entry key=quot;/helloquot; value-ref=quot;helloworldControllerquot; />
    </map>
  </property>
</bean>




                                                                                   Spring MVC
Demo II




Demo II ~ Putting it all to work,
making a simple quot;Hello Worldquot;
Spring MVC application.




                                    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



                                     Multicast / RMI Cache replication

                                Application servers (web)      Backoffice &
                                                                cron jobs             REST (https)           internet


                 REST (https)


signon.vpro.nl
                 SOAP (http)

                                                                                                             belbios
                                                                              XML
                                                        JDBC
                                         JDBC                      LDAP

                                    Database cluster               Active           NFS                 3rd party systems
                                                                  Directory                             (NEBO/DONNA)

  MMBase
                                                                                                 scp




                                                                                                     Spring MVC

Contenu connexe

Tendances

Intro to iOS Application Architecture
Intro to iOS Application ArchitectureIntro to iOS Application Architecture
Intro to iOS Application ArchitectureMake School
 
Lecture java basics
Lecture   java basicsLecture   java basics
Lecture java basicseleksdev
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVCJohn Lewis
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JSBipin
 
Developing for the GeoWeb: Notes From The Field Dev Summit 2009
Developing for the GeoWeb: Notes From The Field Dev Summit 2009Developing for the GeoWeb: Notes From The Field Dev Summit 2009
Developing for the GeoWeb: Notes From The Field Dev Summit 2009Dave Bouwman
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsVirtual Nuggets
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture TutorialJava Success Point
 
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис ЛебедевВстреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис ЛебедевCocoaHeads
 
Massively Scalable Applications - TechFerry
Massively Scalable Applications - TechFerryMassively Scalable Applications - TechFerry
Massively Scalable Applications - TechFerryTechFerry
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorialvinayiqbusiness
 
MV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoaMV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoaYi-Shou Chen
 

Tendances (20)

Signal Framework
Signal FrameworkSignal Framework
Signal Framework
 
Intro to iOS Application Architecture
Intro to iOS Application ArchitectureIntro to iOS Application Architecture
Intro to iOS Application Architecture
 
Lecture java basics
Lecture   java basicsLecture   java basics
Lecture java basics
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Spring MVC 3.0 Framework
Spring MVC 3.0 FrameworkSpring MVC 3.0 Framework
Spring MVC 3.0 Framework
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Developing for the GeoWeb: Notes From The Field Dev Summit 2009
Developing for the GeoWeb: Notes From The Field Dev Summit 2009Developing for the GeoWeb: Notes From The Field Dev Summit 2009
Developing for the GeoWeb: Notes From The Field Dev Summit 2009
 
Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture Tutorial
 
Spring MVC Basics
Spring MVC BasicsSpring MVC Basics
Spring MVC Basics
 
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис ЛебедевВстреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
 
Massively Scalable Applications - TechFerry
Massively Scalable Applications - TechFerryMassively Scalable Applications - TechFerry
Massively Scalable Applications - TechFerry
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
 
Play framework
Play frameworkPlay framework
Play framework
 
MV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoaMV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoa
 

Similaire à Spring MVC introduction HVA

ASP.NET MVC as the next step in web development
ASP.NET MVC as the next step in web developmentASP.NET MVC as the next step in web development
ASP.NET MVC as the next step in web developmentVolodymyr Voytyshyn
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
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
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引Guo Albert
 
quickguide-einnovator-7-spring-mvc
quickguide-einnovator-7-spring-mvcquickguide-einnovator-7-spring-mvc
quickguide-einnovator-7-spring-mvcjorgesimao71
 
Java Web Programming [6/9] : MVC
Java Web Programming [6/9] : MVCJava Web Programming [6/9] : MVC
Java Web Programming [6/9] : MVCIMC Institute
 
Spring MVC framework features and concepts
Spring MVC framework features and conceptsSpring MVC framework features and concepts
Spring MVC framework features and conceptsAsmaShaikh478737
 
Multi client Development with Spring
Multi client Development with SpringMulti client Development with Spring
Multi client Development with SpringJoshua Long
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backboneRTigger
 

Similaire à Spring MVC introduction HVA (20)

Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
 
ASP.NET MVC as the next step in web development
ASP.NET MVC as the next step in web developmentASP.NET MVC as the next step in web development
ASP.NET MVC as the next step in web development
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
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
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引
 
quickguide-einnovator-7-spring-mvc
quickguide-einnovator-7-spring-mvcquickguide-einnovator-7-spring-mvc
quickguide-einnovator-7-spring-mvc
 
Spring mvc 2.0
Spring mvc 2.0Spring mvc 2.0
Spring mvc 2.0
 
MVC & backbone.js
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
 
Introducing spring
Introducing springIntroducing spring
Introducing spring
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Java Web Programming [6/9] : MVC
Java Web Programming [6/9] : MVCJava Web Programming [6/9] : MVC
Java Web Programming [6/9] : MVC
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring MVC framework features and concepts
Spring MVC framework features and conceptsSpring MVC framework features and concepts
Spring MVC framework features and concepts
 
MVC
MVCMVC
MVC
 
Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)
 
Multi client Development with Spring
Multi client Development with SpringMulti client Development with Spring
Multi client Development with Spring
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backbone
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 

Dernier

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Dernier (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Spring MVC introduction HVA

  • 2. peter.maas@finalist.com ☄ maas-frensch.com/peter/ Peter Maas ~ Works at Finalist IT Group. 70% Developer, 20% Architect and 10% CTO Board. Techniques used daily include Java/ JEE, Spring, Hiber nate, JSP. Passionate about scripting language for the JVM like Groovy and JRuby. Spring MVC
  • 3. Introduction to Spring MVC & Web Flow Spring MVC
  • 4. Spring Spring ~ A Layered Java/JEE application framework. The most complete lightweight container, providing centralized, automated configuration and wiring of your application objects. Spring MVC
  • 5. Why Spring (I) Key reasons To provide a non-invasive programming model. As far as possible, application code should be decoupled from the framework. To provide a superior solution to in-house infrastructure, so that developers can focus on delivering business value rather than solving generic problems. To make developing enterprise applications as simple as possible, but enhancing, rather than sacrificing, power. Spring MVC
  • 7. Spring basics <bean id=quot;myRespositoryquot; class=quot;com.finalist.MyRepositoryImplquot;/> <bean id=quot;myServicequot; class=quot;com.finalist.MyServiceImplquot;> <property name=quot;maxResultsquot; value=quot;10quot;/> <property name=quot;myRespositoryquot; ref=quot;myRespositoryquot;/> </bean> Equals myRepository = new MyRepositoryImpl(); myService = new MyServiceImpl(); myService.setMyRepository(myRepository); myService.setMaxResults(10); Spring MVC
  • 8. Spring basics (II) <bean id=quot;myRespositoryquot; class=quot;com.finalist.MyRepositoryImplquot;/> <bean id=quot;myServicequot; class=quot;com.finalist.MyServiceImplquot;> <constructor-arg index=quot;0quot; value=quot;10quot;/> <constructor-arg index=quot;1quot; ref=quot;myRespositoryquot;/> </bean> Equals myRepository = new MyRepositoryImpl(); myService = new MyServiceImpl(10, myRepository); Spring MVC
  • 9. Demo I Demo I ~ Basics of Spring Spring MVC
  • 10. Typical SpringMVC Architecture Spring MVC territory Business logic User Interface Web Domain Connections to exernal Model systems (database, Services webservices) Integration Spring MVC
  • 11. MVC Controller request Model Actor response View Spring MVC
  • 12. Controller Controller ~ Controllers interpret user input and transform such input into a sensible model which will be represented to the user by the view. Spring MVC
  • 13. Controller Interface If you find yourself implementing the controller interface you're probable doing public interface Controller { stuff the hard way! /** * Process the request and return a * ModelAndView object which the DispatcherServlet * will render. */ ModelAndView handleRequest( HttpServletRequest request, HttpServletResponse response) throws Exception; } Spring MVC
  • 14. Controllers «interface» UrlFilenameViewController Controller ParameterizableViewController MultiActionController AbstractController BaseCommandController AbstractCommandController SimpleFormController AbstractFormController AbstractWizardFormController Spring MVC
  • 15. Model Model ~ The domain-specific representation of the information on which the application operates. List<SearchResult> results = new ArrayList<SearchResult>(); model.addObject(quot;searchResultsquot;, results); List<SearchResult> r = (List<SearchResult>)model.get(quot;searchResultsquot;); Spring MVC
  • 16. View View ~ Renders the model into a for m suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes. Spring MVC
  • 17. Views view RedirectView JstlView AbstractExcelView AbstractView InternalResourceView TilesView TilesJstlView AbstractPDFView AbstractUrlB asedView ... AbstractJExcelView AbstractJasperReportsView ... AbstractExcelView AbstractTemplateView AbstractXsltView Spring MVC
  • 18. Handlers Handlers ~ map incoming web requests to appropriate handlers. <bean id=quot;handlerMappingquot; class=quot;org.springframework.web.servlet.handler.BeanNameUrlHandlerMappingquot; /> or <bean id=quot;urlMappingquot; class=quot;org.springframework.web.servlet.handler.SimpleUrlHandlerMappingquot;> <property name=quot;urlMapquot;> <map> <entry key=quot;/helloquot; value-ref=quot;helloworldControllerquot; /> </map> </property> </bean> Spring MVC
  • 19. Demo II Demo II ~ Putting it all to work, making a simple quot;Hello Worldquot; Spring MVC application. Spring MVC
  • 20. 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
  • 21. More to come ~ Complex forms, Binding, Validation, Interceptors, Inter nationalisation, Webflow, Ajax ... Spring MVC
  • 22. internet Firewall & Loadbalancer Multicast / RMI Cache replication Application servers (web) Backoffice & cron jobs REST (https) internet REST (https) signon.vpro.nl SOAP (http) belbios XML JDBC JDBC LDAP Database cluster Active NFS 3rd party systems Directory (NEBO/DONNA) MMBase scp Spring MVC