当前位置: 技术问答>java相关
关于ServletContext的问题
来源: 互联网 发布时间:2015-06-14
本文导语: 使用ServletContext功能给出如下错误提示: D:beawlserver6.1configmydomainapplicationsDefaultWebAppWEB-INF_tmp_war_myserver_myserver_DefaultWebAppjsp_servlet_integration_admin_research__control.java:101: cannot resolve symbol probably occurred due to an error in /i...
使用ServletContext功能给出如下错误提示:
D:beawlserver6.1configmydomainapplicationsDefaultWebAppWEB-INF_tmp_war_myserver_myserver_DefaultWebAppjsp_servlet_integration_admin_research__control.java:101: cannot resolve symbol
probably occurred due to an error in /integration/admin/research/control.jsp line 8:
ServletContext sc = getServletContext();(该句为出错语句!!)
Full compiler error(s):
D:beawlserver6.1configmydomainapplicationsDefaultWebAppWEB-INF_tmp_war_myserver_myserver_DefaultWebAppjsp_servlet_integration_admin_research__control.java:101: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._integration._admin._research.__control
ServletContext sc = getServletContext(); //[ /integration/admin/research/control.jsp; Line: 8]
^
1 error
到底是什么错误呢?
D:beawlserver6.1configmydomainapplicationsDefaultWebAppWEB-INF_tmp_war_myserver_myserver_DefaultWebAppjsp_servlet_integration_admin_research__control.java:101: cannot resolve symbol
probably occurred due to an error in /integration/admin/research/control.jsp line 8:
ServletContext sc = getServletContext();(该句为出错语句!!)
Full compiler error(s):
D:beawlserver6.1configmydomainapplicationsDefaultWebAppWEB-INF_tmp_war_myserver_myserver_DefaultWebAppjsp_servlet_integration_admin_research__control.java:101: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._integration._admin._research.__control
ServletContext sc = getServletContext(); //[ /integration/admin/research/control.jsp; Line: 8]
^
1 error
到底是什么错误呢?
|
对不起,看错了,改成这样应该行把:
ServletContext sc = getServletConfig().getServletContext();
ServletContext sc = getServletConfig().getServletContext();