其他分享
首页 > 其他分享> > dwr2反推

dwr2反推

作者:互联网

package services;

import org.directwebremoting.Browser;
import org.directwebremoting.ScriptSessions;
import org.directwebremoting.ServerContextFactory;
import org.directwebremoting.ui.dwr.Util;

public class HelloServices {
    public String sayHello(String name) {
        System.out.println("Hello now!");
        reverserHello();
        return "Hello " + name + "!";
    }

    /**
     * 反推
     */
    public void reverserHello() {
        String page = ServerContextFactory.get().getContextPath() + "/dept.jsp";
        Browser.withPage(page, new Runnable() {
            public void run() {
                ScriptSessions.addFunctionCall("divShow", "alert");
                Util.setValue("result", "hello horizon!!!");
            }
        });
    }
}

 

标签:String,ServerContextFactory,directwebremoting,反推,org,import,public,dwr2
来源: https://blog.51cto.com/u_2870645/2882459