spring(11)
-
화면에서 배열로 256개 이상의 Data 전송 시 IndexOutOfBoundsException오류 해결 방법
스프링 동적리스트 바인딩의 경우 최대 256개까지가 기본설정으로 되어 있다. 만약, 256개 이상을 파라미터로 넘기게 된다면 IndexOutOfBoundsException이 발생하게 될 것이다. @InitBinderpublic void initBinder(WebDataBinder binder) { binder.setAutoGrowCollectionLimit(1024);} 위와 같이 Controller에 추가를 하여 해결하면 된다. 다른 방법으로 톰캣의 경우 설정하는 법도 있곤 한데.. 그냥 이걸로...ㅋ
2018.03.28 -
Custom Validation Annotion 생성
Spring에서 코드성을 체크하는 validation 없어서 생성하기로 맘먹고 구글링 시작....^ ^ package com.company.common.validation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import javax.validation.Constraint; import javax.validation.Payload; @Documented @Constraint(validat..
2015.08.26 -
[ERROR] Ambiguous mapping found.
Caused by: java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'socialController' bean method 원인 : Controller에 동일한 RequestMapping가 설정되어 있을경우 발생
2015.08.26 -
Spring4 Scheduling - Application
이제 마지막으로 자바를 구동하는 Application 파일입니다. package com.intercast.schedule.stater; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import com.intercast.config.AppConfig; public class Application { @SuppressWarnings("resource") public static void main(String[] args) { // TODO Auto-generated method stub new AnnotationConfigApplicationContext(AppConfig.class); } } Annotat..
2015.05.19 -
Spring4 Scheduling - Demon
실질적으로 Schedule를 설정하는 java 파일입니다. package com.intercast.schedule.service; import javax.annotation.Resource; import org.springframework.scheduling.annotation.Scheduled; public class Demon { @Resource(name="scheduleService") ScheduleService scheduleService; @Scheduled(cron="0/5 * * * * *") public void printHello() { scheduleService.insertUser(); } } 보시는 바와 같이 @Scheduled를 설정합니다. Scheduled 설정에 관하여서는 ..
2015.05.19