코드실행

    [Spring] 스케쥴러 사용해 일정주기마다 코드 실행하기

    스케쥴러를 사용해 일정 주기마다 코드를 실행시키고자 한다 servlet-context.xml 에서 아래 두 줄을 추가한다. xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation= "http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd" xsi:schemaLocation 의 경우 이미 적혀 있는 곳에서 http만 추가해주면된다. 결과 servlet-context.xml 하단에 다음 코드도 추가한다. 패키지 이름은 사용하고자 하는 스케줄러가 있는 위치의 패키지를 작성한다. 자바에서 초 분 시 일..