原因:IntelliJ IDEA 没有导入 servlet-api.jar 这个.jar包,需要手动导入。

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/dd435949-0699-46f6-b6a5-9e0bde4abd65/Snipaste_2021-08-07_18-57-20.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b96d9a51-265d-4203-9bc8-8c4de425fd58/Snipaste_2021-08-07_18-57-40.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/13ce2847-55b1-4d0a-b97a-5071158abee6/Snipaste_2021-08-07_18-58-22.png