티스토리 뷰


@RequestParam: request로부터 query 파라미터 값을 접근하기 위함


    @RequestMapping(value="/order", method = RequestMethod.GET) ... @RequestParam(value="id", required=true) String id


    GET: http://localhost:8081/order?id=1


    optional: defaultValue, name, required, value


@PathVariable: 하나 또는 그 이상의 URL 값이 파라미터로 작동하는 동적URL을 처리함


    @RequestMapping(value="/order/{id}", method = RequestMethod.GET) ... @PathVariable("id") String id


    GET: http://localhost:8081/order/1

댓글
최근에 올라온 글
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31