@어노테이션 정리

이제희·2023년 6월 26일
0

스프링부트

목록 보기
1/3

RequestParam

@GetMapping("/post/view.do")
    public String openPostView(@RequestParam final Long id, Model model) {
        PostResponse post = postService.findPostById(id);
        model.addAttribute("post", post);
        return "post/view";

    }
    @GetMapping("/post/delete.do")
    public String deletePost(@RequestParam final Long id){
        postService.deletePost(id);
        return "redirect:/post/list.do";
    }

RequestParam 어노테이션은 파라미터를 이름으로 바인딩해준다

추가 예정

profile
뭐라도 남기자

0개의 댓글