JavaBean 详解(二)
HttpSession.getAttribute() 方 法 取 得JavaBean对象,例如:
[html]
Person obj=(Person)session.getAttribute(“myBean”);
Application
JavaBean 对象被创建后,它存在于整个Web应用的生命周期内,Web应用中的所有JSP文件都能共享同一个JavaBean对象。
[html]
Person obj=(Person)application.getAttribute(“myBean”);