본문 바로가기

분류 전체보기90

Interceptor 설정 1. servlet-context.xml 2. Interceptor 개발 package secretary.common.filter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; /** * 모든 Controller 수행 전후를 Interceptor 하여 공통처리가 가능한 class */ public class CommonInterceptor extends Hand.. 2020. 3. 17.
Aspectj + 어노테이션으로 로그남기기 1. pom.xml org.aspectj aspectjrt ${org.aspectj-version} org.aspectj aspectjweaver ${org.aspectj-version} org.aspectj aspectjtools ${org.aspectj-version} 2. servelt-context.xml aspectJ설정 3. Annotation Interface 설정 package secretary.common.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annota.. 2020. 3. 17.
LOG4J 설정 1. pom.xml log4j log4j ${log4j-version} 2. log4j 위치 WEB-INF\classes directory 3. log4j.xml 4. Controller package secretary.common.controller; import java.util.Locale; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.sp.. 2020. 3. 17.
MySQL 연결 1. pom.xml org.springframework spring-tx ${org.springframework-version} org.mybatis mybatis-spring ${mybatis-spring-version} org.springframework spring-jdbc ${org.springframework-version} mysql mysql-connector-java ${mysql-version} org.mybatis mybatis ${org.mybatis-version} 2. root-context.xml 3. mybatis-config.xml 4. mapping-query-*.xml SELECT NOW() 5. 서비스 생성 package secretary.common.service; i.. 2020. 3. 16.