Search in sources :

Example 1 with User

use of ua.springboot.web.entity.User in project Logos_Materials_October_2017 by VolodymyrZavada.

the class UserController method showAddUserPage.

@GetMapping("/add")
public String showAddUserPage(Model model) {
    LinkedHashMap<String, String> countryOptions = new LinkedHashMap<>();
    countryOptions.put("BR", "Brazil");
    countryOptions.put("IN", "India");
    countryOptions.put("UA", "Ukraine");
    List<String> languages = new ArrayList<>();
    languages.add("JAVA");
    languages.add("C#");
    languages.add("PHP");
    languages.add("JS");
    model.addAttribute("userRoles", UserRole.values());
    model.addAttribute("languagesList", languages);
    model.addAttribute("countriesList", countryOptions);
    model.addAttribute("userModel", new User());
    return "user/add";
}
Also used : User(ua.springboot.web.entity.User) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 2 with User

use of ua.springboot.web.entity.User in project Logos_Materials_October_2017 by VolodymyrZavada.

the class UserEditor method setAsText.

@Override
public void setAsText(String text) throws IllegalArgumentException {
    User user = userService.findUserById(Integer.valueOf(text));
    setValue(user);
}
Also used : User(ua.springboot.web.entity.User)

Aggregations

User (ua.springboot.web.entity.User)2 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1