SlideShare una empresa de Scribd logo
1 de 26
Présentation générale du framework Spring Auteur: RICHAND Nathaniel
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spring  Core IOC AOP Spring  DAO Spring   Context Spring   Remoting … Spring ORM Spring JDBC Spring   Web RMI Web   Services … JDO Hibernate … Spring MVC Struts JSF …
[object Object],L’IOC n’est pas une  lubie , mais un enjeu primordial pour un développement propre et structuré. Inversion Of Control
[object Object],[object Object],[object Object],Classe A Classe B Dépendance Interface I Classe A Dépendance Classe B
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],+getNomForm() : String +getNomForm() : String FormulaireImpl FormulaireInterface Ceci est plutôt du  traitement  «  métier » Comment se fait le lien entre les deux couches?
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
[object Object],[object Object],[object Object]
DispatcherServlet Controller View Model Request Response
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
import  org.springframework.web.servlet.mvc.SimpleFormController; public   class  FormController  extends  SimpleFormController {  // Méthode appelée avant l’affichage du formulaire, retourne un bean associé au formulaire protected  Object formBackingObject(HttpServletRequest request) { MyBean bean = (MyBean) request.getSession().getAttribute( "myBean" ); if  (bean ==  null ) bean =  new  MyBean(); return  bean; } // Méthode appelée lors du POST du formulaire, reçois le bean associé au formulaire protected  ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object springBean, BindException errors)  throws  Exception { MyBean bean = (MyBean) springBean; request.getSession().setAttribute( "myBean" , bean); return   new  ModelAndView(); } }
GET POST Retourne une instance de la « command » (JavaBean) associée. Initialisation des binders, convertisseurs des données de la requête. Permets de binder des données complémentaires. Typiquement les contenus de listes déroulantes. Le modèle est exposé et la vue est appelée.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Beans Graph Beans View
[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

Workshop spring session 2 - La persistance au sein des applications Java
Workshop spring   session 2 - La persistance au sein des applications JavaWorkshop spring   session 2 - La persistance au sein des applications Java
Workshop spring session 2 - La persistance au sein des applications Java
Antoine Rey
 

La actualidad más candente (20)

Architecture jee principe de inversion de controle et injection des dependances
Architecture jee principe de inversion de controle et injection des dependancesArchitecture jee principe de inversion de controle et injection des dependances
Architecture jee principe de inversion de controle et injection des dependances
 
Cours design pattern m youssfi partie 4 composite
Cours design pattern m youssfi partie 4 compositeCours design pattern m youssfi partie 4 composite
Cours design pattern m youssfi partie 4 composite
 
Support NodeJS avec TypeScript Express MongoDB
Support NodeJS avec TypeScript Express MongoDBSupport NodeJS avec TypeScript Express MongoDB
Support NodeJS avec TypeScript Express MongoDB
 
Support de cours Spring M.youssfi
Support de cours Spring  M.youssfiSupport de cours Spring  M.youssfi
Support de cours Spring M.youssfi
 
Support JEE Servlet Jsp MVC M.Youssfi
Support JEE Servlet Jsp MVC M.YoussfiSupport JEE Servlet Jsp MVC M.Youssfi
Support JEE Servlet Jsp MVC M.Youssfi
 
Cours design pattern m youssfi partie 6 proxy
Cours design pattern m youssfi partie 6 proxyCours design pattern m youssfi partie 6 proxy
Cours design pattern m youssfi partie 6 proxy
 
Support de cours technologie et application m.youssfi
Support de cours technologie et application m.youssfiSupport de cours technologie et application m.youssfi
Support de cours technologie et application m.youssfi
 
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
 
Support de Cours JSF2 Première partie Intégration avec Spring
Support de Cours JSF2 Première partie Intégration avec SpringSupport de Cours JSF2 Première partie Intégration avec Spring
Support de Cours JSF2 Première partie Intégration avec Spring
 
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)Développement d'un site web jee de e commerce basé sur spring (m.youssfi)
Développement d'un site web jee de e commerce basé sur spring (m.youssfi)
 
Workshop spring session 2 - La persistance au sein des applications Java
Workshop spring   session 2 - La persistance au sein des applications JavaWorkshop spring   session 2 - La persistance au sein des applications Java
Workshop spring session 2 - La persistance au sein des applications Java
 
Support Java Avancé Troisième Partie
Support Java Avancé Troisième PartieSupport Java Avancé Troisième Partie
Support Java Avancé Troisième Partie
 
Support Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFISupport Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFI
 
Cours design pattern m youssfi partie 1 introduction et pattern strategy
Cours design pattern m youssfi partie 1 introduction et pattern strategyCours design pattern m youssfi partie 1 introduction et pattern strategy
Cours design pattern m youssfi partie 1 introduction et pattern strategy
 
Formation Spring Avancé gratuite par Ippon 2014
Formation Spring Avancé gratuite par Ippon 2014Formation Spring Avancé gratuite par Ippon 2014
Formation Spring Avancé gratuite par Ippon 2014
 
Introduction à React JS
Introduction à React JSIntroduction à React JS
Introduction à React JS
 
Workshop Spring - Session 1 - L'offre Spring et les bases
Workshop Spring  - Session 1 - L'offre Spring et les basesWorkshop Spring  - Session 1 - L'offre Spring et les bases
Workshop Spring - Session 1 - L'offre Spring et les bases
 
Support developpement applications mobiles avec ionic v3 et v4
Support developpement applications mobiles avec ionic v3 et v4Support developpement applications mobiles avec ionic v3 et v4
Support developpement applications mobiles avec ionic v3 et v4
 
Maven et industrialisation du logiciel
Maven et industrialisation du logicielMaven et industrialisation du logiciel
Maven et industrialisation du logiciel
 
Support de cours angular
Support de cours angularSupport de cours angular
Support de cours angular
 

Destacado

Spring par la pratique chap-7 - mvc
Spring par la pratique  chap-7 - mvcSpring par la pratique  chap-7 - mvc
Spring par la pratique chap-7 - mvc
Florent Breton
 
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - TD
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - TDENIB cours CAI Web - Séance 4 - Frameworks/Spring - TD
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - TD
Horacio Gonzalez
 
Egalite de chances
Egalite de chancesEgalite de chances
Egalite de chances
iesboliches
 

Destacado (6)

Tuto spring
Tuto springTuto spring
Tuto spring
 
Spring par la pratique chap-7 - mvc
Spring par la pratique  chap-7 - mvcSpring par la pratique  chap-7 - mvc
Spring par la pratique chap-7 - mvc
 
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - TD
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - TDENIB cours CAI Web - Séance 4 - Frameworks/Spring - TD
ENIB cours CAI Web - Séance 4 - Frameworks/Spring - TD
 
Egalite de chances
Egalite de chancesEgalite de chances
Egalite de chances
 
Valtech - Du BI au Big Data, une révolution dans l’entreprise
Valtech - Du BI au Big Data, une révolution dans l’entrepriseValtech - Du BI au Big Data, une révolution dans l’entreprise
Valtech - Du BI au Big Data, une révolution dans l’entreprise
 
Alphorm.com Formation Java, les fondamentaux
Alphorm.com Formation Java, les fondamentaux Alphorm.com Formation Java, les fondamentaux
Alphorm.com Formation Java, les fondamentaux
 

Similar a Presentation Spring, Spring MVC

BordeauxJUG : Portails & Portlets Java
BordeauxJUG : Portails & Portlets JavaBordeauxJUG : Portails & Portlets Java
BordeauxJUG : Portails & Portlets Java
Camblor Frédéric
 
Prsentation de-javaserver-faces4124
Prsentation de-javaserver-faces4124Prsentation de-javaserver-faces4124
Prsentation de-javaserver-faces4124
Mejdeddine Bouzouita
 
#J2Code2018 - Mettez du feu à vos applications avec CodeIgniter
#J2Code2018 - Mettez du feu à vos applications avec CodeIgniter#J2Code2018 - Mettez du feu à vos applications avec CodeIgniter
#J2Code2018 - Mettez du feu à vos applications avec CodeIgniter
Atsé François-Xavier KOBON
 
Asp Au Service Des Mv Ps
Asp Au Service Des Mv PsAsp Au Service Des Mv Ps
Asp Au Service Des Mv Ps
Gregory Renard
 
Spring Meetup Paris - Back to the basics of Spring (Boot)
Spring Meetup Paris - Back to the basics of Spring (Boot)Spring Meetup Paris - Back to the basics of Spring (Boot)
Spring Meetup Paris - Back to the basics of Spring (Boot)
Eric SIBER
 

Similar a Presentation Spring, Spring MVC (20)

Spring 3.0
Spring 3.0Spring 3.0
Spring 3.0
 
BordeauxJUG : Portails & Portlets Java
BordeauxJUG : Portails & Portlets JavaBordeauxJUG : Portails & Portlets Java
BordeauxJUG : Portails & Portlets Java
 
Prsentation de-javaserver-faces4124
Prsentation de-javaserver-faces4124Prsentation de-javaserver-faces4124
Prsentation de-javaserver-faces4124
 
Présentation de JavaServer Faces
Présentation de JavaServer FacesPrésentation de JavaServer Faces
Présentation de JavaServer Faces
 
cours-gratuit.com--id-12477.pdf
cours-gratuit.com--id-12477.pdfcours-gratuit.com--id-12477.pdf
cours-gratuit.com--id-12477.pdf
 
Symfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantSymfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 Performant
 
Presentation jsf2
Presentation jsf2Presentation jsf2
Presentation jsf2
 
spring-api-rest.pdf
spring-api-rest.pdfspring-api-rest.pdf
spring-api-rest.pdf
 
Applets
AppletsApplets
Applets
 
20081113 - Nantes Jug - Apache Maven
20081113 - Nantes Jug - Apache Maven20081113 - Nantes Jug - Apache Maven
20081113 - Nantes Jug - Apache Maven
 
#J2Code2018 - Mettez du feu à vos applications avec CodeIgniter
#J2Code2018 - Mettez du feu à vos applications avec CodeIgniter#J2Code2018 - Mettez du feu à vos applications avec CodeIgniter
#J2Code2018 - Mettez du feu à vos applications avec CodeIgniter
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
 
Alt.net spring.net
Alt.net spring.netAlt.net spring.net
Alt.net spring.net
 
Alt.net spring.net
Alt.net spring.netAlt.net spring.net
Alt.net spring.net
 
Spring.NET
Spring.NETSpring.NET
Spring.NET
 
Fondamentaux d'architecture d'une application Flex
Fondamentaux d'architecture d'une application FlexFondamentaux d'architecture d'une application Flex
Fondamentaux d'architecture d'une application Flex
 
Fondamentaux d'architecture d'une application Flex
Fondamentaux d'architecture d'une application FlexFondamentaux d'architecture d'une application Flex
Fondamentaux d'architecture d'une application Flex
 
Asp Au Service Des Mv Ps
Asp Au Service Des Mv PsAsp Au Service Des Mv Ps
Asp Au Service Des Mv Ps
 
Spring Meetup Paris - Back to the basics of Spring (Boot)
Spring Meetup Paris - Back to the basics of Spring (Boot)Spring Meetup Paris - Back to the basics of Spring (Boot)
Spring Meetup Paris - Back to the basics of Spring (Boot)
 

Más de Nathaniel Richand

Brownbaglunch Rétrospective
Brownbaglunch RétrospectiveBrownbaglunch Rétrospective
Brownbaglunch Rétrospective
Nathaniel Richand
 
2010 agile conférence - Comment vendre les tests automatisés
2010 agile conférence - Comment vendre les tests automatisés2010 agile conférence - Comment vendre les tests automatisés
2010 agile conférence - Comment vendre les tests automatisés
Nathaniel Richand
 

Más de Nathaniel Richand (18)

Devenir une entreprise resiliente avec la permagilité
Devenir une entreprise resiliente avec la permagilitéDevenir une entreprise resiliente avec la permagilité
Devenir une entreprise resiliente avec la permagilité
 
Proposition séminaire agile
Proposition séminaire agileProposition séminaire agile
Proposition séminaire agile
 
Permagilite
PermagilitePermagilite
Permagilite
 
2017 brownbaglunch Kanban
2017 brownbaglunch Kanban2017 brownbaglunch Kanban
2017 brownbaglunch Kanban
 
Présentation Dashing
Présentation DashingPrésentation Dashing
Présentation Dashing
 
Devenir une organisation apprenante dans l'IT en 2014
Devenir une organisation apprenante dans l'IT en 2014Devenir une organisation apprenante dans l'IT en 2014
Devenir une organisation apprenante dans l'IT en 2014
 
2013 brownbaglunch - lean startup
2013 brownbaglunch - lean startup2013 brownbaglunch - lean startup
2013 brownbaglunch - lean startup
 
Brownbaglunch Rétrospective
Brownbaglunch RétrospectiveBrownbaglunch Rétrospective
Brownbaglunch Rétrospective
 
Brown baglunch xebia
Brown baglunch xebiaBrown baglunch xebia
Brown baglunch xebia
 
Lean canvas brochure
Lean canvas brochureLean canvas brochure
Lean canvas brochure
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Josiane ScrumDay 2012
Josiane ScrumDay 2012Josiane ScrumDay 2012
Josiane ScrumDay 2012
 
2011 XKE - Kanban in action
2011 XKE - Kanban in action2011 XKE - Kanban in action
2011 XKE - Kanban in action
 
2010 agile conférence - Comment vendre les tests automatisés
2010 agile conférence - Comment vendre les tests automatisés2010 agile conférence - Comment vendre les tests automatisés
2010 agile conférence - Comment vendre les tests automatisés
 
2011 nri-pratiques tests-avancees
2011 nri-pratiques tests-avancees2011 nri-pratiques tests-avancees
2011 nri-pratiques tests-avancees
 
XKE - La communication
XKE - La communicationXKE - La communication
XKE - La communication
 
Presentation Zen
Presentation ZenPresentation Zen
Presentation Zen
 
Tests Logiciel
Tests LogicielTests Logiciel
Tests Logiciel
 

Presentation Spring, Spring MVC

  • 1. Présentation générale du framework Spring Auteur: RICHAND Nathaniel
  • 2.
  • 3.
  • 4.
  • 5. Spring Core IOC AOP Spring DAO Spring Context Spring Remoting … Spring ORM Spring JDBC Spring Web RMI Web Services … JDO Hibernate … Spring MVC Struts JSF …
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. DispatcherServlet Controller View Model Request Response
  • 13.
  • 14. import org.springframework.web.servlet.mvc.SimpleFormController; public class FormController extends SimpleFormController { // Méthode appelée avant l’affichage du formulaire, retourne un bean associé au formulaire protected Object formBackingObject(HttpServletRequest request) { MyBean bean = (MyBean) request.getSession().getAttribute( "myBean" ); if (bean == null ) bean = new MyBean(); return bean; } // Méthode appelée lors du POST du formulaire, reçois le bean associé au formulaire protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object springBean, BindException errors) throws Exception { MyBean bean = (MyBean) springBean; request.getSession().setAttribute( "myBean" , bean); return new ModelAndView(); } }
  • 15. GET POST Retourne une instance de la « command » (JavaBean) associée. Initialisation des binders, convertisseurs des données de la requête. Permets de binder des données complémentaires. Typiquement les contenus de listes déroulantes. Le modèle est exposé et la vue est appelée.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.