您的位置:首页 > 其它

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按钮完成
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: