2022-11-07-TIL

Today I Learned

Metrics

  • https://cloud.ibm.com/docs/java?topic=cloud-native-metrics&locale=ko#:~:text=%EB%A9%94%ED%8A%B8%EB%A6%AD(metrics)%EC%9D%80%20%ED%82%A4%20%EA%B0%92,%ED%8F%89%EA%B7%A0%20%EA%B2%BD%EA%B3%BC%20%EC%8B%9C%EA%B0%84%20%EB%93%B1%EC%9E%85%EB%8B%88%EB%8B%A4.
  • https://12bme.tistory.com/398
  • https://www.inflearn.com/questions/342442

Blob

  • https://heropy.blog/2019/02/28/blob/
  • https://stackoverflow.com/questions/31469136/spring-data-jpa-storing-blob
  • https://thisisspear.tistory.com/68
  • https://stackoverflow.com/questions/72474736/how-to-return-a-blob-file-from-spring-boot-rest-api
  • https://thisisspear.tistory.com/127
  • https://developer.salesforce.com/docs/atlas.en-us.238.0.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm
  • https://stackoverflow.com/questions/18253378/javascript-blob-upload-with-formdata

Object Mapper vs …

  • https://better-dev.netlify.app/java/2020/10/26/compare_objectmapper/
  • https://stackoverflow.com/questions/63600368/difference-between-jackson-objectmapper-to-others
  • https://www.baeldung.com/java-performance-mapping-frameworks

Spring Web Context

  • https://www.baeldung.com/spring-web-contexts

Filter vs OncePerRequestFilter

Filter는 서블릿 컨테이너에서 제공하며 서블릿 컨텍스트에 대한 공통 처리, OncePerRequestFilter는 스프링에서 한 단계 더 추상화하여 Filter를 구현하는 GenericFilterBean 추상 클래스를 상속하는 클래스이다. Filter가 여러번 호출되는 경우에 하나의 요청에 대해서 한 번만 호출되도록 확장한 클래스이다.

  • https://mangkyu.tistory.com/173
  • https://www.baeldung.com/spring-boot-add-filter
  • https://docs.spring.io/spring-integration/reference/html/filter.html
  • https://docs.oracle.com/javaee/6/api/javax/servlet/Filter.html
  • https://www.javatpoint.com/servlet-filter
  • https://tomcat.apache.org/tomcat-5.5-doc/servletapi/index.html
  • https://docs.oracle.com/javaee/7/api/javax/servlet/Servlet.html
  • https://www.digitalocean.com/community/tutorials/java-servlet-filter-example-tutorial
  • https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/filter/package-summary.html
  • https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/filter/OncePerRequestFilter.html
  • https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/filter/GenericFilterBean.html
  • https://minkukjo.github.io/framework/2020/12/18/Spring-142/
  • https://gardeny.tistory.com/35
  • https://pgnt.tistory.com/102
  • https://dev-racoon.tistory.com/34
  • https://stackoverflow.com/questions/50410901/genericfilterbean-vs-onceperrequestfilter-when-to-use-each

@ControllerAdvice vs ErrorController

  • ErrorController는 커스텀 whitelabel 에러 페이지를 제공할 때 사용한다.
  • @ControllerAdvice 애너테이션이 명시된 클래스는 애플리케이션 전체에 대해 글로벌 예외 핸들링 로직을 포함하는데 사용된다.

따라서, 애플리케이션 안에서 요청이나 페이지에 대한 매핑을 찾을 수 없다면 스프링은 ‘whitelabel error page'로 대체한다. 그리고 이 경우에 커스텀 구현된 ErrorController로 대체가 가능하다.

  • https://stackoverflow.com/questions/40489606/spring-controlleradvice-vs-errorcontroller
  • https://www.appsloveworld.com/springmvc/100/4/spring-controlleradvice-vs-errorcontroller
  • https://www.baeldung.com/exception-handling-for-rest-with-spring
  • https://thepracticaldeveloper.com/custom-error-handling-rest-controllers-spring-boot/
  • https://www.digitalocean.com/community/tutorials/spring-mvc-exception-handling-controlleradvice-exceptionhandler-handlerexceptionresolver
  • https://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc
  • https://reflectoring.io/spring-boot-exception-handling/
  • https://recordsoflife.tistory.com/30