1.1 application
*在jsp中获得application对象
如:getServletContext().setAttribute("counter",new mycount.Counter());
如:jsp:useBean scope="application" id="counter" class="mycounter.Counter"/
*在jsp中处理On Application Start和On Session Start事件的方法
使用HttpSessionBindingListener类.
添加session:
session.putValue("bingdings.listener",new MyListener(getServletContext());
定义MyListener类:
import javax.servlet.http.*;
import javax.servlet.*;
public class MyListener implements HttpSessionBindingListener{
Servl...[ 查看全文 ]