MyEclipse开发项目时遇到HttpServletResponse报红叉怎么办?
程序员文章站
2022-06-25 20:10:22
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
再看代码,红叉已经解决