您的位置:首页 > 移动开发

jsp、Servlet、Struts1.X 中使用application对象

2008-12-03 15:50 337 查看
在jsp中使用application

<%

applicaiton.setAttribute(”userId”, “testUser”);

%>

在servlet中使用application

ServletContext application = getServletConfig().getServletContext();

//或者

ServletContext application=httpServletRequest.getSession().getServletContext();

在Struts1.X Action 类中中使用application

ServletContext application = getServlet().getServletConfig().getServletContext();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐