Ignore:
Timestamp:
02/05/22 22:48:19 (3 years ago)
Author:
Petar Partaloski <ppartaloski@…>
Branches:
main
Children:
2efe93e
Parents:
5b447b0
Message:

Fixed and added a better front end, improved clarity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/wediscussmovies/project/web/controller/PersonController.java

    r5b447b0 rf25e8dd  
    4545        model.addAttribute("persons", persons);
    4646        model.addAttribute("contentTemplate", "personsList");
     47        return "template";
     48    }
     49
     50    @GetMapping("/persons/{id}")
     51    public String getPerson(@PathVariable Integer id, Model model){
     52        Person person = personService.findById(id);
     53        //Error handling, could be null!!!!!!!!!
     54        model.addAttribute("person", person);
     55
     56        model.addAttribute("contentTemplate", "personShow");
    4757        return "template";
    4858    }
Note: See TracChangeset for help on using the changeset viewer.