<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<display-name></display-name>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description></description>
<display-name>AsynServlet</display-name>
<servlet-name>AsynServlet</servlet-name>
<servlet-class>com.imooc.servlet.AsynServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AsynServlet</servlet-name>
<url-pattern>/AsynServlet</url-pattern>
</servlet-mapping>
</web-app>
<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>com.imooc.serlvet.LoginServlet</servlet-class>
<async-supported>true</async-supported>
</servlet>
//servlet标签有个属性,叫做async-supported,把把它设置为true就行,示例如上
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/servlet/LoginServlet</url-pattern>
</servlet-mapping>