배열(2)
-
[Spring] RequestParam으로 배열 처리
- ajax로 보낼 경우@RequestParam(value="arr[]" String[] arr) - get 또는 post로 보낼 경우@RequestParam(value="arr" String[] arr)
2018.06.19 -
화면에서 배열로 256개 이상의 Data 전송 시 IndexOutOfBoundsException오류 해결 방법
스프링 동적리스트 바인딩의 경우 최대 256개까지가 기본설정으로 되어 있다. 만약, 256개 이상을 파라미터로 넘기게 된다면 IndexOutOfBoundsException이 발생하게 될 것이다. @InitBinderpublic void initBinder(WebDataBinder binder) { binder.setAutoGrowCollectionLimit(1024);} 위와 같이 Controller에 추가를 하여 해결하면 된다. 다른 방법으로 톰캣의 경우 설정하는 법도 있곤 한데.. 그냥 이걸로...ㅋ
2018.03.28