Servlet 组件:Servlet、Filter、Listener
- Servlet
实现:@WebServlet
URL 映射:@WebServlet(urlPatterns = "/my/servlet")
注册:@ServletComponentScan(basePackages = “com.purejoy.test.servlet”)
Servlet 注册:Servlet注解、Spring Bean、RegistrationBean
- Spring Bean
@Bean - RegistrationBean
ServletRegistrationBean
FilterRegistrationBean
ServletListenerRegistrationBean
异步非阻塞:异步 Servlet、非阻塞 Servlet
- 异步 Servlet
javax.servlet.ServletRequest#startAsync()
javax.servlet.AsyncContext - 非阻塞 Servlet
javax.servlet.ServletInputStream#setReadListener
javax.servlet.ReadListener
javax.servlet.ServletOutputStream#setWriteListener
javax.servlet.WriteListener
网友评论