SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
Conception d'Applications
Interactives :
Applications Web et JEE
Séance #5
TD Grails
Objectif
● Dans les 2 séances précédentes, vous avez
travaillé à remplir des trous dans des
applications déjà faites
○ Modèle de développement complèxe
● Maintenant c'est à vous de faire l'application
○ En partant de zéro
Installation de Grails
● Sur votre poste personnel :
○ Pré-requis : Java JDK 6 ou JDK 7
○ Moteur Grails : http://www.grails.org/
○ IDE GGTS (base Eclipse) : http://www.springsource.
org/downloads/sts-ggts
Des clés USB a disposition pour l'install Windows et
Linux
Installation de Grails
● Sur un poste ENIB :
○ Moteur Grails :
/home/TP/modules/sujets/CAI/DevWeb/grails
○ IDE GGTS (base Eclipse) :
/home/TP/modules/sujets/CAI/DevWeb/ggts
Le moteur Grails et l'IDE s'exécutent
depuis leur répertoire d'installation
Créer une application grails
● Démarrer le GGTS et créer un nouveau
projet Grails : enibieres
Créer une application grails
● Exécuter l'application avec run-app
● Vérifier sur le navigateur http://localhost:
8080/ENIBieres/
Création du modèle de données
● Créer une Domain Class enibieres.Beer
○ Attributs : id, name, brewery, country, alcohol
○ Traduction en Groovy du POJO du TD Servlet
○ Si votre Domain Class fait plus de 10 lignes, c'est
trop !
Création du controleur
● Créer un Controller enibieres.
BeerController
○ Pour tester rapidement :
■ Dans la méthode index() faire
render "Hello ENIB"
Créer une bière
● Dans BeerController ajouter ce qu'il faut pour
pouvoir ajouter, enlever, modifier et lister des
bières
○ Si la classe fait plus de 5 lignes, vous faites fausse
route
L'alcool est entre 0 et 90 degrées !
● Dans BeerController utiliser des constraints
pour
○ Afficher les champs dans le bon ordre (name d'abord)
○ N'accepter des champs à vide
○ N'accepter des valeurs d'alcohol qu'entre 0 et 90
Stock options
● Il ne nous manque que gérer le stock
● Dans le modèle, ajouter un champ stock

Más contenido relacionado

Destacado

Enib cours c.a.i. web - séance #5 - groovy
Enib   cours c.a.i. web - séance #5 - groovyEnib   cours c.a.i. web - séance #5 - groovy
Enib cours c.a.i. web - séance #5 - groovyHoracio Gonzalez
 
Présentation Groovy
Présentation GroovyPrésentation Groovy
Présentation Groovyguest6e3bed
 
Groovy presentation.
Groovy presentation.Groovy presentation.
Groovy presentation.Infinity
 
Présentation Groovy
Présentation GroovyPrésentation Groovy
Présentation GroovyJS Bournival
 
Application Architectures in Grails
Application Architectures in GrailsApplication Architectures in Grails
Application Architectures in GrailsPeter Ledbrook
 
GP Chapitre 3 La gestion des stocks
GP Chapitre 3 La gestion des stocks GP Chapitre 3 La gestion des stocks
GP Chapitre 3 La gestion des stocks ibtissam el hassani
 
Document
DocumentDocument
DocumentViewOn
 
Mag Up and Under (n°11)
Mag Up and Under (n°11) Mag Up and Under (n°11)
Mag Up and Under (n°11) Marc De Jongy
 
Proyecto de d.h.p. presentación
Proyecto de d.h.p. presentación Proyecto de d.h.p. presentación
Proyecto de d.h.p. presentación Marlutte Jestrelt
 
Liu Bolin arta camuflajului
Liu Bolin arta camuflajuluiLiu Bolin arta camuflajului
Liu Bolin arta camuflajuluiViorica Munteanu
 
Polo a tierra
Polo a tierraPolo a tierra
Polo a tierrakarin gil
 
Paisaje granitico
Paisaje graniticoPaisaje granitico
Paisaje graniticopaularr15
 
Inspirez vous de Denis Vincent de Calgary!
Inspirez vous de Denis Vincent de Calgary!Inspirez vous de Denis Vincent de Calgary!
Inspirez vous de Denis Vincent de Calgary!Denis Vincent
 
Denis vincent helico
Denis vincent helicoDenis vincent helico
Denis vincent helicoDenis Vincent
 
Francophone Belgium feedback on 'Basics for teachers'
Francophone Belgium feedback on 'Basics for teachers'Francophone Belgium feedback on 'Basics for teachers'
Francophone Belgium feedback on 'Basics for teachers'Dyslexia International
 
Bpm azure gpn6 automatiza procesos v1
Bpm azure gpn6 automatiza procesos v1Bpm azure gpn6 automatiza procesos v1
Bpm azure gpn6 automatiza procesos v1Juan Cabello
 

Destacado (20)

Enib cours c.a.i. web - séance #5 - groovy
Enib   cours c.a.i. web - séance #5 - groovyEnib   cours c.a.i. web - séance #5 - groovy
Enib cours c.a.i. web - séance #5 - groovy
 
Présentation Groovy
Présentation GroovyPrésentation Groovy
Présentation Groovy
 
Dynamic Languages
Dynamic LanguagesDynamic Languages
Dynamic Languages
 
Groovy presentation.
Groovy presentation.Groovy presentation.
Groovy presentation.
 
Présentation Groovy
Présentation GroovyPrésentation Groovy
Présentation Groovy
 
Introduction to Grails
Introduction to GrailsIntroduction to Grails
Introduction to Grails
 
Application Architectures in Grails
Application Architectures in GrailsApplication Architectures in Grails
Application Architectures in Grails
 
GP Chapitre 3 La gestion des stocks
GP Chapitre 3 La gestion des stocks GP Chapitre 3 La gestion des stocks
GP Chapitre 3 La gestion des stocks
 
Document
DocumentDocument
Document
 
Mag Up and Under (n°11)
Mag Up and Under (n°11) Mag Up and Under (n°11)
Mag Up and Under (n°11)
 
Proyecto de d.h.p. presentación
Proyecto de d.h.p. presentación Proyecto de d.h.p. presentación
Proyecto de d.h.p. presentación
 
Liu Bolin arta camuflajului
Liu Bolin arta camuflajuluiLiu Bolin arta camuflajului
Liu Bolin arta camuflajului
 
Polo a tierra
Polo a tierraPolo a tierra
Polo a tierra
 
Gala du plombier d'or 2013
Gala du plombier d'or 2013Gala du plombier d'or 2013
Gala du plombier d'or 2013
 
Paisaje granitico
Paisaje graniticoPaisaje granitico
Paisaje granitico
 
Inspirez vous de Denis Vincent de Calgary!
Inspirez vous de Denis Vincent de Calgary!Inspirez vous de Denis Vincent de Calgary!
Inspirez vous de Denis Vincent de Calgary!
 
Sistemas Operativos
Sistemas OperativosSistemas Operativos
Sistemas Operativos
 
Denis vincent helico
Denis vincent helicoDenis vincent helico
Denis vincent helico
 
Francophone Belgium feedback on 'Basics for teachers'
Francophone Belgium feedback on 'Basics for teachers'Francophone Belgium feedback on 'Basics for teachers'
Francophone Belgium feedback on 'Basics for teachers'
 
Bpm azure gpn6 automatiza procesos v1
Bpm azure gpn6 automatiza procesos v1Bpm azure gpn6 automatiza procesos v1
Bpm azure gpn6 automatiza procesos v1
 

Similar a Enib cours c.a.i. web - séance #5 : td grails

ENIB 2013-2014 - CAI Web #3: J’ai besoin d’une appli web rapidement
ENIB 2013-2014 - CAI Web #3: J’ai besoin d’une appli web rapidementENIB 2013-2014 - CAI Web #3: J’ai besoin d’une appli web rapidement
ENIB 2013-2014 - CAI Web #3: J’ai besoin d’une appli web rapidementHoracio Gonzalez
 
Enib cours c.a.i. web - séance #5 - j’ai besoin d’une appli web rapidement !
Enib   cours c.a.i. web - séance #5 - j’ai besoin d’une appli web rapidement !Enib   cours c.a.i. web - séance #5 - j’ai besoin d’une appli web rapidement !
Enib cours c.a.i. web - séance #5 - j’ai besoin d’une appli web rapidement !Horacio Gonzalez
 
Prérequis au développement google android
Prérequis au développement google androidPrérequis au développement google android
Prérequis au développement google androidThierry Gayet
 
Paris Container Day 2016 : Cloudunit v2 (Treeptik)
Paris Container Day 2016 : Cloudunit v2 (Treeptik)Paris Container Day 2016 : Cloudunit v2 (Treeptik)
Paris Container Day 2016 : Cloudunit v2 (Treeptik)Publicis Sapient Engineering
 
Gulp fiction, Builder, tester, livrer, sans tomber dans les poms - breizhcam...
Gulp fiction, Builder, tester, livrer, sans tomber dans les poms  - breizhcam...Gulp fiction, Builder, tester, livrer, sans tomber dans les poms  - breizhcam...
Gulp fiction, Builder, tester, livrer, sans tomber dans les poms - breizhcam...mbrechet
 
CI, CD, pipelines, conteneurs : la cohabitation est elle possible ?
CI, CD, pipelines, conteneurs : la cohabitation est elle possible ?CI, CD, pipelines, conteneurs : la cohabitation est elle possible ?
CI, CD, pipelines, conteneurs : la cohabitation est elle possible ?Membré Guillaume
 
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour androidDébuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour androidBosco Basabana
 
la boite à outils de développements dans firefox devtools
la boite à outils de développements dans firefox devtoolsla boite à outils de développements dans firefox devtools
la boite à outils de développements dans firefox devtoolsChristophe Villeneuve
 
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...XavierPestel
 
Des poneys à Liberation.fr
Des poneys à Liberation.frDes poneys à Liberation.fr
Des poneys à Liberation.frliberation_dev
 
Conférence Shinken à SophiaConf2012 (Jean Gabès)
Conférence Shinken à SophiaConf2012 (Jean Gabès)Conférence Shinken à SophiaConf2012 (Jean Gabès)
Conférence Shinken à SophiaConf2012 (Jean Gabès)Jean Gabès
 
Hackathon Android Abidjan
Hackathon Android  AbidjanHackathon Android  Abidjan
Hackathon Android AbidjanBacely YoroBi
 
presentation Ganttproject (TIC et orga)
presentation Ganttproject (TIC et orga)presentation Ganttproject (TIC et orga)
presentation Ganttproject (TIC et orga)Romand
 

Similar a Enib cours c.a.i. web - séance #5 : td grails (20)

ENIB 2013-2014 - CAI Web #3: J’ai besoin d’une appli web rapidement
ENIB 2013-2014 - CAI Web #3: J’ai besoin d’une appli web rapidementENIB 2013-2014 - CAI Web #3: J’ai besoin d’une appli web rapidement
ENIB 2013-2014 - CAI Web #3: J’ai besoin d’une appli web rapidement
 
Enib cours c.a.i. web - séance #5 - j’ai besoin d’une appli web rapidement !
Enib   cours c.a.i. web - séance #5 - j’ai besoin d’une appli web rapidement !Enib   cours c.a.i. web - séance #5 - j’ai besoin d’une appli web rapidement !
Enib cours c.a.i. web - séance #5 - j’ai besoin d’une appli web rapidement !
 
Prérequis au développement google android
Prérequis au développement google androidPrérequis au développement google android
Prérequis au développement google android
 
Paris Container Day 2016 : Cloudunit v2 (Treeptik)
Paris Container Day 2016 : Cloudunit v2 (Treeptik)Paris Container Day 2016 : Cloudunit v2 (Treeptik)
Paris Container Day 2016 : Cloudunit v2 (Treeptik)
 
Gulp fiction, Builder, tester, livrer, sans tomber dans les poms - breizhcam...
Gulp fiction, Builder, tester, livrer, sans tomber dans les poms  - breizhcam...Gulp fiction, Builder, tester, livrer, sans tomber dans les poms  - breizhcam...
Gulp fiction, Builder, tester, livrer, sans tomber dans les poms - breizhcam...
 
CI, CD, pipelines, conteneurs : la cohabitation est elle possible ?
CI, CD, pipelines, conteneurs : la cohabitation est elle possible ?CI, CD, pipelines, conteneurs : la cohabitation est elle possible ?
CI, CD, pipelines, conteneurs : la cohabitation est elle possible ?
 
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour androidDébuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
 
Android NDK
Android   NDKAndroid   NDK
Android NDK
 
la boite à outils de développements dans firefox devtools
la boite à outils de développements dans firefox devtoolsla boite à outils de développements dans firefox devtools
la boite à outils de développements dans firefox devtools
 
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
 
Des poneys à Liberation.fr
Des poneys à Liberation.frDes poneys à Liberation.fr
Des poneys à Liberation.fr
 
Hello droid
Hello droidHello droid
Hello droid
 
Logiciels 3d-112-ktcufc
Logiciels 3d-112-ktcufcLogiciels 3d-112-ktcufc
Logiciels 3d-112-ktcufc
 
Conférence Shinken à SophiaConf2012 (Jean Gabès)
Conférence Shinken à SophiaConf2012 (Jean Gabès)Conférence Shinken à SophiaConf2012 (Jean Gabès)
Conférence Shinken à SophiaConf2012 (Jean Gabès)
 
B2G
B2GB2G
B2G
 
B2 g
B2 gB2 g
B2 g
 
Apache Cordova 3.3 de zéro
Apache Cordova 3.3 de zéroApache Cordova 3.3 de zéro
Apache Cordova 3.3 de zéro
 
Hackathon Android Abidjan
Hackathon Android  AbidjanHackathon Android  Abidjan
Hackathon Android Abidjan
 
Cours cordova & REST
Cours cordova & RESTCours cordova & REST
Cours cordova & REST
 
presentation Ganttproject (TIC et orga)
presentation Ganttproject (TIC et orga)presentation Ganttproject (TIC et orga)
presentation Ganttproject (TIC et orga)
 

Más de Horacio Gonzalez

Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27
Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27
Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27Horacio Gonzalez
 
But there is no web component for that - Web Components Remote Conference - 2...
But there is no web component for that - Web Components Remote Conference - 2...But there is no web component for that - Web Components Remote Conference - 2...
But there is no web component for that - Web Components Remote Conference - 2...Horacio Gonzalez
 
Mixité dans le monde des WebComponents - DevFest Toulouse - 2017-09-27
 Mixité dans le monde des WebComponents - DevFest Toulouse - 2017-09-27 Mixité dans le monde des WebComponents - DevFest Toulouse - 2017-09-27
Mixité dans le monde des WebComponents - DevFest Toulouse - 2017-09-27Horacio Gonzalez
 
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 2/3 - HTML5, CSS3, Twitter B...
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 2/3 - HTML5, CSS3, Twitter B...ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 2/3 - HTML5, CSS3, Twitter B...
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 2/3 - HTML5, CSS3, Twitter B...Horacio Gonzalez
 
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JSENIB 2016 2017 - CAI Web S02E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JSHoracio Gonzalez
 
Battle of Frameworks: Polymer - Meetup Paris Web Components - 2016-09
Battle of Frameworks: Polymer - Meetup Paris Web Components - 2016-09Battle of Frameworks: Polymer - Meetup Paris Web Components - 2016-09
Battle of Frameworks: Polymer - Meetup Paris Web Components - 2016-09Horacio Gonzalez
 
Mixing Web Components - Best of Web Paris - 2016 06-09
Mixing Web Components - Best of Web Paris - 2016 06-09Mixing Web Components - Best of Web Paris - 2016 06-09
Mixing Web Components - Best of Web Paris - 2016 06-09Horacio Gonzalez
 
Polymer in the real life - Devoxx France - 2016 04-20
Polymer in the real life - Devoxx France - 2016 04-20Polymer in the real life - Devoxx France - 2016 04-20
Polymer in the real life - Devoxx France - 2016 04-20Horacio Gonzalez
 
Warp10: collect, store and manipulate sensor data - BreizhCamp - 2016 03-24
Warp10: collect, store and manipulate sensor data - BreizhCamp - 2016 03-24 Warp10: collect, store and manipulate sensor data - BreizhCamp - 2016 03-24
Warp10: collect, store and manipulate sensor data - BreizhCamp - 2016 03-24 Horacio Gonzalez
 
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScriptENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScriptHoracio Gonzalez
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...Horacio Gonzalez
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 2/3 - HTML5 / CSS3 / Twitter...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 2/3 - HTML5 / CSS3 / Twitter...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 2/3 - HTML5 / CSS3 / Twitter...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 2/3 - HTML5 / CSS3 / Twitter...Horacio Gonzalez
 
ENIB 2015 2016 - CAI Web S02E03 - Forge JS 2/4 - MongoDB and NoSQL
ENIB 2015 2016 - CAI Web S02E03 - Forge JS 2/4 - MongoDB and NoSQLENIB 2015 2016 - CAI Web S02E03 - Forge JS 2/4 - MongoDB and NoSQL
ENIB 2015 2016 - CAI Web S02E03 - Forge JS 2/4 - MongoDB and NoSQLHoracio Gonzalez
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 1/3 - HTTP, HTML, CSS JS
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 1/3 - HTTP, HTML, CSS JSENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 1/3 - HTTP, HTML, CSS JS
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 1/3 - HTTP, HTML, CSS JSHoracio Gonzalez
 
ENIB 2015-2016 - CAI Web - S01E01- MongoDB and NoSQL
ENIB 2015-2016 - CAI Web - S01E01- MongoDB and NoSQLENIB 2015-2016 - CAI Web - S01E01- MongoDB and NoSQL
ENIB 2015-2016 - CAI Web - S01E01- MongoDB and NoSQLHoracio Gonzalez
 
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScriptENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScriptHoracio Gonzalez
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 2/3 - HTML5, CSS3, Twitte...
ENIB 2015-2016 - CAI Web -  S01E01- Côté navigateur 2/3 - HTML5, CSS3, Twitte...ENIB 2015-2016 - CAI Web -  S01E01- Côté navigateur 2/3 - HTML5, CSS3, Twitte...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 2/3 - HTML5, CSS3, Twitte...Horacio Gonzalez
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
ENIB 2015-2016 - CAI Web -  S01E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JSENIB 2015-2016 - CAI Web -  S01E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JSHoracio Gonzalez
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...Horacio Gonzalez
 
Beyond Polymer - JUG Summer Camp - 2015-09-18
Beyond Polymer - JUG Summer Camp - 2015-09-18Beyond Polymer - JUG Summer Camp - 2015-09-18
Beyond Polymer - JUG Summer Camp - 2015-09-18Horacio Gonzalez
 

Más de Horacio Gonzalez (20)

Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27
Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27
Il n'y a pas que Polymer dans la vie… - RennesJS - 2017-06-27
 
But there is no web component for that - Web Components Remote Conference - 2...
But there is no web component for that - Web Components Remote Conference - 2...But there is no web component for that - Web Components Remote Conference - 2...
But there is no web component for that - Web Components Remote Conference - 2...
 
Mixité dans le monde des WebComponents - DevFest Toulouse - 2017-09-27
 Mixité dans le monde des WebComponents - DevFest Toulouse - 2017-09-27 Mixité dans le monde des WebComponents - DevFest Toulouse - 2017-09-27
Mixité dans le monde des WebComponents - DevFest Toulouse - 2017-09-27
 
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 2/3 - HTML5, CSS3, Twitter B...
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 2/3 - HTML5, CSS3, Twitter B...ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 2/3 - HTML5, CSS3, Twitter B...
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 2/3 - HTML5, CSS3, Twitter B...
 
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JSENIB 2016 2017 - CAI Web S02E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
ENIB 2016 2017 - CAI Web S02E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
 
Battle of Frameworks: Polymer - Meetup Paris Web Components - 2016-09
Battle of Frameworks: Polymer - Meetup Paris Web Components - 2016-09Battle of Frameworks: Polymer - Meetup Paris Web Components - 2016-09
Battle of Frameworks: Polymer - Meetup Paris Web Components - 2016-09
 
Mixing Web Components - Best of Web Paris - 2016 06-09
Mixing Web Components - Best of Web Paris - 2016 06-09Mixing Web Components - Best of Web Paris - 2016 06-09
Mixing Web Components - Best of Web Paris - 2016 06-09
 
Polymer in the real life - Devoxx France - 2016 04-20
Polymer in the real life - Devoxx France - 2016 04-20Polymer in the real life - Devoxx France - 2016 04-20
Polymer in the real life - Devoxx France - 2016 04-20
 
Warp10: collect, store and manipulate sensor data - BreizhCamp - 2016 03-24
Warp10: collect, store and manipulate sensor data - BreizhCamp - 2016 03-24 Warp10: collect, store and manipulate sensor data - BreizhCamp - 2016 03-24
Warp10: collect, store and manipulate sensor data - BreizhCamp - 2016 03-24
 
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScriptENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 2/3 - HTML5 / CSS3 / Twitter...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 2/3 - HTML5 / CSS3 / Twitter...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 2/3 - HTML5 / CSS3 / Twitter...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 2/3 - HTML5 / CSS3 / Twitter...
 
ENIB 2015 2016 - CAI Web S02E03 - Forge JS 2/4 - MongoDB and NoSQL
ENIB 2015 2016 - CAI Web S02E03 - Forge JS 2/4 - MongoDB and NoSQLENIB 2015 2016 - CAI Web S02E03 - Forge JS 2/4 - MongoDB and NoSQL
ENIB 2015 2016 - CAI Web S02E03 - Forge JS 2/4 - MongoDB and NoSQL
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 1/3 - HTTP, HTML, CSS JS
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 1/3 - HTTP, HTML, CSS JSENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 1/3 - HTTP, HTML, CSS JS
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 1/3 - HTTP, HTML, CSS JS
 
ENIB 2015-2016 - CAI Web - S01E01- MongoDB and NoSQL
ENIB 2015-2016 - CAI Web - S01E01- MongoDB and NoSQLENIB 2015-2016 - CAI Web - S01E01- MongoDB and NoSQL
ENIB 2015-2016 - CAI Web - S01E01- MongoDB and NoSQL
 
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScriptENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 2/3 - HTML5, CSS3, Twitte...
ENIB 2015-2016 - CAI Web -  S01E01- Côté navigateur 2/3 - HTML5, CSS3, Twitte...ENIB 2015-2016 - CAI Web -  S01E01- Côté navigateur 2/3 - HTML5, CSS3, Twitte...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 2/3 - HTML5, CSS3, Twitte...
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
ENIB 2015-2016 - CAI Web -  S01E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JSENIB 2015-2016 - CAI Web -  S01E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 1/3 - HTTP, HTML, CSS, JS
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
 
Beyond Polymer - JUG Summer Camp - 2015-09-18
Beyond Polymer - JUG Summer Camp - 2015-09-18Beyond Polymer - JUG Summer Camp - 2015-09-18
Beyond Polymer - JUG Summer Camp - 2015-09-18
 

Enib cours c.a.i. web - séance #5 : td grails

  • 2. Objectif ● Dans les 2 séances précédentes, vous avez travaillé à remplir des trous dans des applications déjà faites ○ Modèle de développement complèxe ● Maintenant c'est à vous de faire l'application ○ En partant de zéro
  • 3. Installation de Grails ● Sur votre poste personnel : ○ Pré-requis : Java JDK 6 ou JDK 7 ○ Moteur Grails : http://www.grails.org/ ○ IDE GGTS (base Eclipse) : http://www.springsource. org/downloads/sts-ggts Des clés USB a disposition pour l'install Windows et Linux
  • 4. Installation de Grails ● Sur un poste ENIB : ○ Moteur Grails : /home/TP/modules/sujets/CAI/DevWeb/grails ○ IDE GGTS (base Eclipse) : /home/TP/modules/sujets/CAI/DevWeb/ggts Le moteur Grails et l'IDE s'exécutent depuis leur répertoire d'installation
  • 5. Créer une application grails ● Démarrer le GGTS et créer un nouveau projet Grails : enibieres
  • 6. Créer une application grails ● Exécuter l'application avec run-app ● Vérifier sur le navigateur http://localhost: 8080/ENIBieres/
  • 7. Création du modèle de données ● Créer une Domain Class enibieres.Beer ○ Attributs : id, name, brewery, country, alcohol ○ Traduction en Groovy du POJO du TD Servlet ○ Si votre Domain Class fait plus de 10 lignes, c'est trop !
  • 8. Création du controleur ● Créer un Controller enibieres. BeerController ○ Pour tester rapidement : ■ Dans la méthode index() faire render "Hello ENIB"
  • 9. Créer une bière ● Dans BeerController ajouter ce qu'il faut pour pouvoir ajouter, enlever, modifier et lister des bières ○ Si la classe fait plus de 5 lignes, vous faites fausse route
  • 10. L'alcool est entre 0 et 90 degrées ! ● Dans BeerController utiliser des constraints pour ○ Afficher les champs dans le bon ordre (name d'abord) ○ N'accepter des champs à vide ○ N'accepter des valeurs d'alcohol qu'entre 0 et 90
  • 11. Stock options ● Il ne nous manque que gérer le stock ● Dans le modèle, ajouter un champ stock