Cookie Cannot be resolved to a type
2017-09-11 16:45
1501 查看
Eclipse java-web项目,学习Cookie时,出现Cookie Cannot be resolved to a type问题。
(1) 尝试导入Cookie包:<%@ page import="javax.servlet.http.Cookie" %>
问题并未解决,Cookie处仍然提示Cookie Cannot be resolved to a type,而且在Cookie包语句上提示:The import java.servlet cannot be resolved,这其实是软件包java.servlet不存在,从tomcat中导入就可以了。
(2) 其次,右键项目-->Build Path-->Configure Build Path --> Libraries -->Add Library
(3) 选择Server Runtime,单击Next按钮,再选择服务器(如Apache Tomcat v9.0),单击Finish按钮完成
(1) 尝试导入Cookie包:<%@ page import="javax.servlet.http.Cookie" %>
问题并未解决,Cookie处仍然提示Cookie Cannot be resolved to a type,而且在Cookie包语句上提示:The import java.servlet cannot be resolved,这其实是软件包java.servlet不存在,从tomcat中导入就可以了。
(2) 其次,右键项目-->Build Path-->Configure Build Path --> Libraries -->Add Library
(3) 选择Server Runtime,单击Next按钮,再选择服务器(如Apache Tomcat v9.0),单击Finish按钮完成
相关文章推荐
- Cookie cannot be resolved to a type
- Httpservlet cannot be resolved to a type的原因与解决方法
- Maven创建Web项目,jsp引入静态文件提示报错(javax.servlet.ServletException cannot be resolved to a type ) 解决办法
- cannot be resolved to a type in same package 问题解决
- Eclipse “cannot be resolved to a type” error
- Eclipse “cannot be resolved to a type” error
- HttpServlet cannot be resolved to a type
- android编译错误“OnClickListener cannot be resolved to a type”解决方案
- activity cannot be resolved to a type
- xxx cannot be resolved to a type 错误解决方法
- javax.servlet.jsp.pagecontext cannot be resolved to a type异常记录
- javax.servlet.ServletException cannot be resolved to a type错误解决方法
- String cannot be resolved to a type怎么解决
- Maven - [ClassName] cannot be resolved to a type.
- Session cannot be resolved to a type
- HttpServlet cannot be resolved to a type 解决办法
- class cannot be resolved to a type 或者JSP import class cannot be resolved to
- @SpringBootApplication cannot be resolved to a type In STS
- textview cannot be resolved to a type 解决方法
- 工程报错:javax.servlet.jsp.JspException cannot be resolved to a type