[Spring] RequestParam으로 배열 처리
- ajax로 보낼 경우@RequestParam(value="arr[]" String[] arr) - get 또는 post로 보낼 경우@RequestParam(value="arr" String[] arr)
kamsi76.tistory.com
뷰에서 여러 인풋을 만들어두고
그 인풋을 배열로 받아 백단에서 메일을 전송하려 한다
이를 배열로 받으려면
@RequestMapping(value = "/joinus/emailAuth", method = RequestMethod.POST)
public String emailAuth(@RequestParam(value="email[]") String[] email) {
다음과 같이 @RequestParam에서 배열을 설정해준다
'개발' 카테고리의 다른 글
리액트 7일차 : node, 빌드 (0) | 2023.01.03 |
---|---|
230102 : WebSocket (0) | 2023.01.02 |
리액트 5일차 : Redux (0) | 2022.12.30 |
리액트 4일차 : context API, axios (0) | 2022.12.30 |
에러일기 : com.sun.mail.smtp.SMTPSenderFailedException: 550 5.7.0 Restricted by spam policy (0) | 2022.12.29 |