Search in sources :

Example 1 with Student

use of ua.spring.web.entity.Student in project Logos_Materials_October_2017 by VolodymyrZavada.

the class StudentController method showStudentForm.

@GetMapping("/add")
public String showStudentForm(Model model) {
    LinkedHashMap<String, String> countryOptions = new LinkedHashMap<>();
    countryOptions.put("BR", "Brazil");
    countryOptions.put("FR", "France");
    countryOptions.put("DE", "Germany");
    countryOptions.put("IN", "India");
    countryOptions.put("US", "United States of America");
    countryOptions.put("UA", "Ukraine");
    List<String> radioOptions = new ArrayList<>();
    radioOptions.add("Java");
    radioOptions.add("C#");
    radioOptions.add("PHP");
    radioOptions.add("Ruby");
    model.addAttribute("studentModel", new Student());
    model.addAttribute("countries", countryOptions);
    model.addAttribute("favoriteLanguages", radioOptions);
    model.addAttribute("studentDegrees", StudentDegree.values());
    return "student-add";
}
Also used : ArrayList(java.util.ArrayList) Student(ua.spring.web.entity.Student) LinkedHashMap(java.util.LinkedHashMap) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 Student (ua.spring.web.entity.Student)1