1) I want to close specific browser tab using url address from my java code. As it is a client server applicaiton. I want to close browser tab using url address from my client
I am using following code to filter on the basis of login user. There you have to change the condition accordingly.
WebContext webContext = WebContextFactory.get();
Collection ss = webContext.getAllScriptSessions();
for (ScriptSession s : ss) {
if (s.getAttribute("uname")!=null && s.getAttribute("uname").equals(to)) {
Util util = new Util(s);
ScriptBuffer sc= new ScriptBuffer();
sc.appendScript("window.close()");
util.addScript(sc);
}
}