본문 바로가기

RequestParam 참고: https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-requestparam\ 요청 파라미터 (uri의 쿼리 파라미터 or form-data) 를 특정 클래스 인스터스로 바인딩해주는 역할. Note that use of @RequestParam is optional (for example, to set its attributes). By default, any argument that is a simple value type (as determined by BeanUtils#isSimpleProperty) and is not resolved by any other argument resolver,..
ResponseEntity 응답 본문 뿐만 아니라, 헤더, 상태코드까지 설정가능하다. 즉, 응답 전체를 내 마음대로 조작할 수 있다. 반면에 @ResponseBody는 메소드의 반환값이 바디에 들어가는 것을 설정할 뿐, 상태코드, 헤더 등을 조작할 수는 없다. 참고: https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-return-types
RequestMapping 스프링 mvc에서 특정 요청을 처리하는 핸들러를 명시할 때 사용하는 어노테이션을 제공한다. 이를 사용하면 손쉽게 특정 요청을 처리하도록 설정할 수 있고, 간결해서 가독성에도 좋다. name : 해당 언노테이션에게 별칭을 붙이기 위해 사용 value : 처리할 uri 패턴들(String 배열)을 기입. ex. RequestMapping(value={"/spring", "/mvc"}) RequestMapping("/spring/{name}") RequestMapping("/spring/*") RequestMapping("/spring/**") RequestMapping("/spring/?") 여기서 ?: matches one character *: matches zero or more characters w..
HandlerMapping Dispatcher Servlet은 프로퍼티로 handlerMapping 구현체 컬렉션을 가지고 있다. 스프링 mvc에서 사용하는 HandlerMapping은 말 그대로 요청을 처리할 핸들러를 연결하는 역할이다. HandlerMapping은 아래와 같은 인터페이스이다. 여기서 getHandler를 통해 해당 요청(HttpServletRequest)를 처리할 수 있는 핸들러를 찾아서 HandlerExecutionChain 객체를 반환한다. HandlerExecutionChain은 간단히 말해, handler와 interceptor등 요청 하나를 처리하기 위한 흐름을 하나의 객체에 모아둔 것이라고 보면 된다. 이를 위해 HandlerMapping의 구현체는 url과 핸들러를 매핑하는 mappingTable을..
Resource Handler 스프링은 정적인 데이터를 서빙하는 역할을하는 리소스 핸들러를 제공한다. 핸들러를 설정하는 방법은 간단하다. 아래와 같이 WebMvcConfigurer를 상속하여 addResourceHandlers를 구현하면 된다. 결과적으로는 핸들러 매핑이 디스패처 서블릿에 추가되는데, 이 핸들러 매핑은 우선순위가 낮아서 다른 핸들러매핑이 처리하지 않으면 리소스 처리가 이뤄지는 방식인 듯 하다(이건 좀더 확인해봐야지) 스프링이 리소스 핸들러를 설정하는 코드는 스프링mvc의 DefaultServletHandlerConfigurer 클래스를 참조하면 좋을 듯 하다. ps. 기존에 톰캣과 같은 서블릿 컨테이너는 기본으로 제공하는 서블릿이 있다. 바로 default servlet이다. (default servlet of tom..
Ansible이란? 공식 홈페이지에 의하면.. Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. : 각종 작업들을 자동화할 수 있는 도구라고 보면 된다. 앤서블의 장점: AgentLess 앤서블이 지지층을 빠르게 확보할 수 있었는 특징 중 하나는 agent-less 이다. 무슨 뜻이냐면, 작업 대상이 되는 노드에 별도의 무언가를 설치할 필요가 없다. 작업을 명령할 내 컴퓨터에만 ansible을 설치하면 준비는 끝난다. 또 다른 장점: 모듈..
Init 프로세스 출처: https://en.wikipedia.org/wiki/Init
데몬(Daemon)이란? A daemon is a type of program on Unix-like operating systems that runs unobtrusively in the background, rather than under the direct control of a user, waiting to be activated by the occurance of a specific event or condition. 출처: http://www.linfo.org/daemon.html Daemon Definition A daemon is a type of program on Unix-like operating systems that runs unobtrusively in the background, rather than ..