原文:The method getServletContext() is undefined for the type HttpServletRequest

request.getServletContext .getRealPath 已經加入了 sun runtime library但是還是提示錯誤 是因為 寫法過時了改成request.getSession .getServletContext .getRealPath ...

2017-04-27 09:12 1 3591 推薦指數:

查看詳情

The method getContextPath() from the type HttpServletRequest

在做java項目開發的時候,jsp頁面很容易報出這個錯誤。 錯誤的原因很多,但是都和JRE有關。 一般在導入項目的時候容易報出這個錯誤,主要因為JRE(jdk版本不一致)。 解決方法:就是重新配 ...

Wed Jun 29 03:00:00 CST 2016 0 5571
The method getTextContent() is undefined for the type Node

eclipse 中 如果加入了 其他了xfire 等其他xml解析包的話,使用org.w3c.dom.Node下的getTextContent()方法會出現The method getTextContent() is undefined for the type Node 提示,解決方法 ...

Mon Jul 02 05:38:00 CST 2012 1 19333
Cannot resolve method 'getServletContext()'報錯

這個報錯原因是因為pom依賴導包servlet-api的版本錯誤: 在調用request.getServletContext()的方法需要servlet-api的版本3.0以上才可以 所以把之前的版本修改一下就可以了,我使用的是3.1.0版本的。如下:     < ...

Fri Mar 20 05:37:00 CST 2020 0 1454
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM