HttpServletRequest cannot be resolved to a type。
问题描述:
HttpServletRequest cannot be resolved to a type。
Multiple markers at this line
- The import javax.servlet.http cannot be resolved
- The import javax.servlet.http cannot be resolved
- The import javax.servlet.http cannot be resolved
解决方案:
1.这个错误可能是服务器自带的servlet库未导入的原因。
2.右键项目属性,转到Targeted Runtimes,选择一个服务器,例如Tomcat,单击应用,可能就可以解决。
3.或者一开始建立项目就如下Targeted Runtimes