首页 > 学院 > 编程设计 > 正文

MyEclipse开发项目时遇到HttpServletResponse报红叉怎么办?

2020-07-14 13:52:01
字体:
来源:转载
供稿:网友

今天写代码时,发现HttpServletResponse response = ServletActionContext.getResponse();这句报红叉,提示The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files,并要求configuration build path,经过尝试之后,发现解决办法。

错误情况:HttpServletResponse response = ServletActionContext.getResponse();这句报红叉

提示:The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files,并要求configuration build path

解决办法:点击提示中的configuration build path(或者右键项目,点击Build Path->configuration build path),打开build path界面后,选择Libraries选项卡,并单击Add Library,如图

选择MyEclipse Libraries,点击Next

找到Java EE 5,点击Finish

再看代码,红叉已经解决

相关推荐:

myeclipse怎么设置Spring支持?

MyEclipse中Servers窗口在哪里怎么显示?

MyEclipse怎么配置jdk? myeclipse配置jdk的图文教程

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表