编程开发

关注公众号 jb51net

关闭
软件教程 > 编程开发 >

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

脚本之家

今天写代码时,发现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的图文教程