Spring #Spring Framework #Model #ModelAttribute #RequestParam1 Model & ModelAttribute & RequestParam & PathVariable Model 백엔드 - > 프론트로 데이터를 전달할때 사용한다. @RequestMapping("/main") public String main(Model model) { System.out.println("메인페이지로"); ObjectMapper objectMapper = new ObjectMapper(); int ranNum = 1321232131; List objectlist = promotionservice.selectAllPromotion(); String list = null; try { list = objectMapper.writeValueAsString(objectlist); } catch (JsonProcessingException e) { e.printStackTrace(); } model.. 2024. 3. 7. 이전 1 다음