当前位置: 技术问答>java相关
Help me, Please!!!
来源: 互联网 发布时间:2014-12-27
本文导语: 我用JSP写getServletContext()方法,需要将用户信息放入Application,可运行时报错,说getServletContext()方法没找到,不知如何解决 | 直接调用 ServletContext 想session 那样。 | 放入: Se...
我用JSP写getServletContext()方法,需要将用户信息放入Application,可运行时报错,说getServletContext()方法没找到,不知如何解决
|
直接调用 ServletContext 想session 那样。
|
放入:
ServletContext sc = getServletContext();
sc.setAttribute("UserName",vecUserName);
取出:
ServletContext sc = getServletContext();
Vector vecUserName = (Vector)sc.getArrtibute(("UserName");
ServletContext sc = getServletContext();
sc.setAttribute("UserName",vecUserName);
取出:
ServletContext sc = getServletContext();
Vector vecUserName = (Vector)sc.getArrtibute(("UserName");
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。