1. @RequestMapping @PostMapping @GetMapping
@GetMapping和@PostMapping是组合注解
@GetMapping=@RequestMapping(method = RequestMethod.GET)
@PostMapping=@RequestMapping(method = RequestMethod.POST)
2. @Value
@Value("#{}")与@Value("${}")的区别
3. Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
4. @PostConstruct
被@PostConstruct修饰的方法会在服务器加载Servlet的时候运行,并且只会被服务器执行一次。
服务器加载Servlet------》Servlet构造函数------》PostConstruct------》Init-------》destroy-------》predestroy------》服务器卸载servlet完毕
如果想在生成对象时完成某些初始化操作,而偏偏这些初始化操作又依赖于依赖注入,那么久无法在构造函数中实现。为此,可以使用@PostConstruct注解一个方法来完成初始化,@PostConstruct注解的方法将会在依赖注入完成后被自动调用。