Changeset aea04dd for src/main/java/com
- Timestamp:
- 02/03/24 17:15:01 (9 months ago)
- Branches:
- master
- Children:
- d4d8fb9
- Parents:
- 501396e
- Location:
- src/main/java/com/example/cookbook
- Files:
-
- 4 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/cookbook/controller/HomeController.java
r501396e raea04dd 2 2 3 3 4 import com.example.cookbook.model.Komentar; 4 5 import com.example.cookbook.model.Recept; 5 6 import com.example.cookbook.model.Slika; 6 7 import com.example.cookbook.model.Sostojka; 7 8 import com.example.cookbook.model.exception.ReceptNeEPronajdenException; 9 import com.example.cookbook.service.KomentariService; 8 10 import com.example.cookbook.service.ReceptService; 9 11 import com.example.cookbook.service.SlikiService; … … 25 27 private final SostojkiService sostojkiService; 26 28 27 public HomeController(ReceptService receptService, SlikiService slikiService, SostojkiService sostojkiService) { 29 private final KomentariService komentariService; 30 31 public HomeController(ReceptService receptService, 32 SlikiService slikiService, 33 SostojkiService sostojkiService, KomentariService komentariService) { 28 34 29 35 this.receptService = receptService; 30 36 this.slikiService = slikiService; 31 37 this.sostojkiService = sostojkiService; 38 this.komentariService = komentariService; 32 39 } 33 40 … … 51 58 List<Slika> sliki; 52 59 List<Sostojka> sostojki; 60 List<Komentar> komentari; 53 61 try { 54 62 recept = receptService.findById(id); 55 63 sliki = slikiService.findAllPicById(id); 56 64 sostojki = sostojkiService.findAllById(id); 65 komentari = komentariService.findAllById(id); 57 66 } catch (SQLException e) { 58 67 return "redirect:/error-page/SQL%20Exception"; … … 63 72 model.addAttribute("sliki", sliki); 64 73 model.addAttribute("sostojki", sostojki); 74 model.addAttribute("komentari", komentari); 65 75 return "recept"; 66 76 }
Note:
See TracChangeset
for help on using the changeset viewer.