今天寫(xiě)代碼時(shí),發(fā)現(xiàn)HttpServletResponse response = ServletActionContext.getResponse();這句報(bào)紅叉,提示The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files,并要求configuration build path,經(jīng)過(guò)嘗試之后,發(fā)現(xiàn)解決辦法。
錯(cuò)誤情況:HttpServletResponse response = ServletActionContext.getResponse();這句報(bào)紅叉
提示:The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files,并要求configuration build path
解決辦法:點(diǎn)擊提示中的configuration build path(或者右鍵項(xiàng)目,點(diǎn)擊Build Path->configuration build path),打開(kāi)build path界面后,選擇Libraries選項(xiàng)卡,并單擊Add Library,如圖
選擇MyEclipse Libraries,點(diǎn)擊Next
找到Java EE 5,點(diǎn)擊Finish
再看代碼,紅叉已經(jīng)解決
相關(guān)推薦:
myeclipse怎么設(shè)置Spring支持?
MyEclipse中Servers窗口在哪里怎么顯示?
MyEclipse怎么配置jdk? myeclipse配置jdk的圖文教程
新聞熱點(diǎn)
疑難解答
圖片精選