Giter Site home page Giter Site logo

emmanuelaron / grade-submission Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 68 KB

I am following a great springboot lesson on udemy and wanted to explicit certains notions , for better memorization

Home Page: https://www.udemy.com/course/the-complete-spring-boot-development-bootcamp

Java 34.59% CSS 44.51% HTML 20.90%

grade-submission's Introduction

grade-submission

Ceci est un push du projet issu du cours: (chapitre : Grade submission - ou validation du formulaire)
https://www.udemy.com/course/the-complete-spring-boot-development-bootcamp

Objet Grade :
propriétés : String name ; String subject;String score; (Exemple : Potter ; Potions ; C+)

2 formulaires:
Le formulaire form.html et grades.html

Le formulaire grades.html est visible sur l'URL http://localhost:8081/grades car on a @GetMapping("/grades")
-> Dans le GradeController :

  • Une liste d'objets Grade studentGrades est passé en attribut au Modele.Cette liste d'objet Grade étant une variable globale de GradeController qui est initialement vide
  • Cette liste d'objets correspond aux lignes du formulaire ajoutées dynamiquement : Le principe est de rajouter des lignes du formulaire en html lorsque la liste d'objets se peuple...
    Le formulaire form.html est visible sur l'URL http://localhost:8081 car on a @GetMapping("/")
    -> Dans le GradeController :
    Un objet Grade est passé en attribut au Modele.
    -> Correspond aux 3 champs du formulaire (Name, Score,Subject).
    -> Un champ par propriété de l'objet Grade.



Controller GradeController.java:

On a également une méthode:
 @PostMapping("/handleSubmit")
    public String submitForm(Grade grade){
      studentGrades.add(grade);
      return "redirect:/grades";
    }
qui correspond à l'action handleSubmit dans le formulaire "post".Lorsqu'on valide le formulaire (methode POST) on est redirigé ("redirect:/grades") vers l'URL : http://localhost:8081/grades
   

grade-submission's People

Contributors

emmanuelaron avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.