首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

弹出系统揭示

2013-10-01 
弹出系统提示public String noticemessage(){ChatManager.noticeRebackMessage(this.getRequest(), notice

弹出系统提示

public String noticemessage(){ChatManager.noticeRebackMessage(this.getRequest(), noticemessage);return "this";//本页面}package com.web.utils;import java.util.Collection;import java.util.List;import javax.servlet.ServletContext;import javax.servlet.http.HttpServletRequest;import org.apache.commons.lang.StringUtils;import org.directwebremoting.ScriptBuffer;import org.directwebremoting.ScriptSession;import org.directwebremoting.ServerContext;import org.directwebremoting.ServerContextFactory;import org.directwebremoting.WebContext;import org.directwebremoting.WebContextFactory;public class ChatManager {public static void noticeOrderMessage(HttpServletRequest request, String message, String pps) {WebContext wctx = WebContextFactory.get();ScriptBuffer script = new ScriptBuffer();script.appendScript("receiveMessages(").appendData(message).appendScript(",").appendData(pps).appendScript(");");        //获得DWR上下文ServletContext sc = request.getSession().getServletContext();ServerContext sctx = ServerContextFactory.get(sc);//获得当前浏览 index.jsp 页面的所有脚本sessionCollection<ScriptSession> pages = sctx.getScriptSessionsByPage(request.getContextPath()+"/top.jsp");for (ScriptSession session : pages) {session.addScript(script);}}public static void noticeRebackMessage(HttpServletRequest request, String message) {WebContext wctx = WebContextFactory.get();ScriptBuffer script = new ScriptBuffer();script.appendScript("rebackMessages(").appendData(message).appendScript(");");//script.appendScript("rebackMessages(www);");        //获得DWR上下文ServletContext sc = request.getSession().getServletContext();ServerContext sctx = ServerContextFactory.get(sc);//获得当前浏览 index.jsp 页面的所有脚本sessionCollection<ScriptSession> pages = sctx.getScriptSessionsByPage(request.getContextPath()+"/top.jsp");for (ScriptSession session : pages) {session.addScript(script);}}public static boolean isshow(String userpps,String pps){List<String> list=Tools.getListString(userpps);if(StringUtils.isNotEmpty(pps)){for(String pp:list){if(pps.contains(pp))return true;}}return  false;}}

热点排行