jsp The method getServletContext() is undefined for the type in eclipse解决方法

来源:互联网 发布:李凌 知象 编辑:程序博客网 时间:2024/05/21 22:27

getServletContext()这个方法在Servlet 3.0规范里才有,要tomcat7才行。

如果使用的tomact6.0就会报这个错,必须增加一个extended Servlet,方法如下:

File->Properties -> Java Build Path -> Libraries -> Add Library -> Server Runtime


0 0
原创粉丝点击