原文: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