Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
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
Archives
Today
Total
관리 메뉴

ENN

[Mybatis] @RequestParam 사용하기 본문

백엔드

[Mybatis] @RequestParam 사용하기

s_eonxx 2022. 9. 20. 08:10

controller에서 분명 DTO의 파라미터와 mapper.xml의 값을 같게 사용하였는데 에러가 발생했다.

데이터베이스의 모든 컬럼을 not null로 설정해줬고 필요하다면 default 값도 설정해 놓았는데 생긴 오류였다.

 

 

내용)

BindingException: Parameter '...' not found. Available parameters are [arg2, arg1, arg0, param1, param2]

 

위는 컴파일러가 파라미터를 발견을 못해서 생기는 오류로, controller에 @RequestParam("userid")와 같이 직접 파라미터 명시를 해줘야 한다.

 

@PostMapping("/users/login")
    public void postlogin(@RequestParam("userid") String userid, @RequestParam("userpw") ...)