java (3) 썸네일형 리스트형 Spring Filter package com.example.filter; import org.springframework.web.util.ContentCachingRequestWrapper; import org.springframework.web.util.ContentCachingResponseWrapper; import javax.servlet.*; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @WebFilter(urlPatterns = "/api/*") public class A.. Spring AOP ( annotation 활용) [Class] @Aspect [Method] @PointCut 표현식 예제 참고 사이트) https://docs.spring.io/spring-framework/docs/2.5.x/reference/aop.html @Before : 이전 @After : 이후 @AfterReturning : 정상적 반환 이후 @AfterThrowing : 예외 발생 이후 @Around : 메소드 실행 전후 어노테이션을 이용한 AOP 적용 예제 package com.example.aop.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolic.. Spring Exception [Class] @ControllerAdvice or @RestControllerAdvice value basePackages basePackageClasses assignableTypes annotations [Method] @ExceptionHandler value @ResponseStatus ... @RestControllerAdvice public class GlobalControllerAdvice { 예제 1) @ExceptionHandler(value = Exception.class) public ResponseEntity 메서드명a(Exception e){ ... return ResponseEntity.status(HttpStatus.코드).body(내용); } 예제 2) @ExceptionH.. 이전 1 다음