*This annotation is used to declare the configuration of a javax.servlet.Servlet. If the name attribute is not defined, the fully qualified name of the class is used. 이 어노테이션은 javax.servelt.Servlet의 구성을 선언하기 위해 사용됩니다.
At least one URL pattern MUST be declared in either the value or urlPattern attribute of the annotation, but not both. 적어도 어노테이션 속성으로 value, urlPattern 중 하나에 반드시 URL Pattern을 선언해야 합니다. 하지만 둘 다 선언할 수는 없습니다.
The value attribute is recommended for use when the URL pattern is the only attribute being set, otherwise the urlPattern attribute should be used. value는 다른 애트리뷰트 없이 사용될 때만 권장되며 나머지는 urlPattern을 반드시 사용해야 합니다.
The class on which this annotation is declared MUST extend javax.servlet.http.HttpServlet. 이 어노테이션이 선언된 클래스는 반드시 javax.servlet.http.HttpServlet 클래스를 상속해야 합니다.
Since: Servlet 3.0 (Section 8.1.1)*
*Enables scanning for Servlet components (filters, servlets, and listeners). Scanning is only performed when using an embedded web server. 서블릿 컴포넌트들(@WebServlet, @WebFilter, @WebListener)의 스캔을 가능케 해줍니다. 스캐닝은 내장 웹 서버를 사용하는 경우에만 수행됩니다.
Typically, one of value, basePackages, or basePackageClasses should be specified to control the packages to be scanned for components. In their absence, scanning will be performed from the package of the class with the annotation. 일반적으로 컴포넌트 스캔의 대상이 되고자 하는 패키지를 제어하려면 value, basePackages 또는 basePackageClass 중 하나를 지정해야 합니다. 만약 없을 경우 주석이 위치한 클래스의 패키지에서 스캔이 수행됩니다.
Since: 1.3.0*
*Annotation that indicates a method return value should be bound to the web response body. Supported for annotated handler methods. (핸들러) 메서드의 리턴 값을 나타내는 어노테이션으로 웹 response body에 바인딩되어야 합니다. 이 어노테이션은 핸들러 메서드에 대해 지원이 가능합니다.
As of version 4.0 this annotation can also be added on the type level in which case it is inherited and does not need to be added on the method level. 4.0 버전에서 이 어노테이션은 타입 수준에서도 추가될 수 있으며, 이 경우 상속이 가능하고 메서드 수준에서 추가될 필요가 없습니다.
Since: 3.0*
@RequestBody 는 HttpRequestBody를 전송하거나 도메인 객체에 매핑하여 Body 내용을 자바 객체로 자동으로 역직렬화하는 과정을 제공합니다. 즉 어노테이션에 적합한 객체가 매핑되어 있는 경우라면 본문이 Java Type으로 자동 변환됩니다.*Annotation indicating a method parameter should be bound to the body of the web request. (핸들러) 메서드 파라미터를 나타내는 어노테이션으로 웹 request의 body에 바인딩되어야 한다.
The body of the request is passed through an HttpMessageConverter to resolve the method argument depending on the content type of the request. Optionally, automatic validation can be applied by annotating the argument with @Valid. 이 어노테이션이 매핑된 경우 request body는 request(HTTP Header)의 Content type에 따라 메서드 인자를 처리하기 위한 HttpMessageConver를 통과하게 됩니다. 또한 선택적으로 메서드 인자에 @Valid 어노테이션을 추가해 자동 유효성 검증을 수행할 수 있습니다.
Supported for annotated handler methods. 이 어노테이션은 핸들러 메서드에 대해 지원됩니다.
Since: 3.0*
@RestController 은 내부적으로 @ResponseBody 와 @Controller가 합쳐져 있는 것을 확인할 수 있습니다.
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
**@Controller**
**@ResponseBody**
public @interface RestController {
String value() default "";
}
Causes lombok to generate a logger field. *lombok에서 인스턴스 필드에 logger를 생성합니다.
Example: @Slf4j public class LogExample { }
will generate: public class LogExample { private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExample.class); }*
*Annotation that binds a method parameter or method return value to a named model attribute, exposed to a web view. Supported for controller classes with @RequestMapping methods. 이 어노테이션은 메서드 인자 혹은 메서드 반환 값을 Web View에 노출되는 model attribute에 바인딩합니다. @RequestMapping이 명시된 컨트롤러 클래스의 메서드에 대해 지원됩니다.
Can be used to expose command objects to a web view, using specific attribute names, through annotating corresponding parameters of an @RequestMapping method. @RequestMapping 메서드의 매개 변수에 주석을 달아 특정 속성 이름을 사용하여 명령 객체를 웹 보기에 노출하는 데 사용할 수 있습니다.
Can also be used to expose reference data to a web view through annotating accessor methods in a controller class with @RequestMapping methods. Such accessor methods are allowed to have any arguments that @RequestMapping methods support, returning the model attribute value to expose. @RequestMapping 메서드를 사용하여 컨트롤러 클래스의 접근자 메서드에 주석을 달아 참조 데이터를 웹 뷰에 노출하는 데도 사용할 수 있습니다. 이러한 접근자 메서드는 @RequestMapping 메서드가 지원하는 인수를 가질 수 있으므로 모델 속성 값을 반환하여 노출할 수 있습니다.
Note however that reference data and all other model content is not available to web views when request processing results in an Exception since the exception could be raised at any time making the content of the model unreliable. For this reason @ExceptionHandler methods do not provide access to a Model argument. 그러나 모델 내용을 신뢰할 수 없게 만들 수 있는 예외가 언제든지 발생할 수 있으므로 요청 처리 결과 예외가 발생할 경우 참조 데이터와 다른 모든 모델 콘텐츠를 웹 뷰에서 사용할 수 없습니다. 이러한 이유로 @ExceptionHandler 메서드는 Model 인수에 대한 액세스를 제공하지 않습니다.
Since: 2.5*