问题:
- 项目内报错
HttpServletRequest cannot be resolved to a type
。 - 找不到
HttpServletRequest
,HttpServletResponse
,ServletException
。
解决:
原因: jdk 里不包括servlet-api.jar 这个包,此包在Tomcat 中存在。
将这个jar包复制到项目中的lib目录下即可导入
为了防止自己在出现类似的错误找不到,特地记录了一下~
HttpServletRequest cannot be resolved to a type
。HttpServletRequest
,HttpServletResponse
,ServletException
。原因: jdk 里不包括servlet-api.jar 这个包,此包在Tomcat 中存在。
将这个jar包复制到项目中的lib目录下即可导入
为了防止自己在出现类似的错误找不到,特地记录了一下~