getServletContext()
在jsp中直接就可以用
<%
application.setAttribute("key","hello");
out.println(this.getServletContext().getAttribute("key"));
%>
在jsp中直接就可以用
<%
application.setAttribute("key","hello");
out.println(this.getServletContext().getAttribute("key"));
%>
解决方案 »
- 怎样才能使action执行后,仍停留在当前页面?
- 追问org.apache.jasper.JasperException: /test.jsp(10,0) UseBean has invalid attribu
- 跪求!java于oracle连接池!!!
- ****请问如何解决标签中的中文问题或看过《jsp应用开发详解》第16章的朋友进****
- 我有一个下拉框,但被flash挡住了!怎么才能显示出来啊!?在线等!
- 上传数据问题!!!!!!!急阿!!!!!!
- 用strucst开发的程序能否在其他web上使用,如resin?
- 紧急求救!!!在servlet中取得的hashmap怎么为空,请大虾指教!!!
- 奇怪的问题,请各位帮我看看~!
- 在把textarea里的数据存入数据库,读出时可以换行,但空格却的不到,文字都顶头写,以下是我的代码。
- 如果解决两个表相关联的问题,都进来看看
- 200分求JSP电子教案(PowerPoint格式)
--------------------------------------------------------------------------------
E:\bea\user_projects\ECSNDomain\.\ECSNServer\.wlnotdelete\extract\ECSNServer__appsdir_DefaultWebApp_dir_DefaultWebApp\jsp_servlet\__test.java:118: cannot resolve symbol
probably occurred due to an error in /test.jsp line 3:
out.println(this.getServletContext().getAttribute("key"));
--------------------------------------------------------------------------------
Full compiler error(s):
E:\bea\user_projects\ECSNDomain\.\ECSNServer\.wlnotdelete\extract\ECSNServer__appsdir_DefaultWebApp_dir_DefaultWebApp\jsp_servlet\__test.java:118: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet.__test
out.println(this.getServletContext().getAttribute("key")); //[ /test.jsp; Line: 3]
^
1 error
--------------------------------------------------------------------------------
Sun Sep 19 02:44:42 GMT+08:00 2004