ServerContext context = ServerContextFactory.get();
// 获得客户端页面script session连接数Collection<ScriptSession> sessions = context.getScriptSessionsByPage( "/chat.jsp");sessions 什么总是null呢,求解决

解决方案 »

  1.   

    //获得DWR上下文  
            ServletContext sc = request.getSession().getServletContext();  
            ServerContext sctx = ServerContextFactory.get(sc);  
            //获得当前浏览 index.jsp 页面的所有脚本session  
            Collection sessions = sctx.getScriptSessionsByPage("/chat/index.jsp"); 
      

  2.   


    ServerContext context = ServerContextFactory.get();
    // 获得客户端所有chat页面script session连接数
    System.out.println(ctx);
    Collection<ScriptSession> sessions = context.getScriptSessionsByPa( ctx.getContextPath()+"/chat.jsp");
    我已经试过很多方法了,现在主要考虑的问题是,是否配置中有限制或者哪里配置不正确导致的获取不到,
      

  3.   

    //获得DWR上下文   
      ServletContext sc = request.getSession().getServletContext();   
      ServerContext sctx = ServerContextFactory.get(sc);   
      //获得当前浏览 index.jsp 页面的所有脚本session   
      Collection sessions = sctx.getScriptSessionsByPage("/chat/index.jsp");
    为什么我在电脑浏览器上能过获取,但是在手机浏览器上却不行呢?????