1、MyServlet class文件所处的目录结构如下:
2、如果在url里直接引用是不行的,http://localhost:9092/GetRequest_Web_exploded/MyServlet
3、需要在web.xml映射后才行:
MyServlet
com.example.MyServlet
<servlet-mapping><servlet-name>MyServlet</servlet-name><url-pattern>/MyServlet</url-pattern>
</servlet-mapping>