Hi all,
I want to remove one attribute of all online sessions. I have cached a content of one short textfile to session. But the problem occur when i update the textfile, it continue use old content so that is reason which i want to remove the attribute of all online session.
Any one meet this problem? Please help me...
The include my code in a jsp as following:
result =(String) session.getAttribute("TVMS");
if(result == "" || result == null){
try{
System.out.println("RUNNING READ FILE CODE");
BufferedReader reader = new BufferedReader(new FileReader(application.getRealPath("/")+"/TVMS.txt"));
StringBuilder sb = new StringBuilder();
String line;
while((line = reader.readLine())!= null){
result += line + "^";
}
session.setAttribute("TVMS", result.substring(0, result.length()-1));
}catch (Exception e) {
e.printStackTrace();
}
And in javascript I declare a list:
var tvmslist = "<%=result%>".split('^');
function runText(){
if("<%=userid%>" == "testhcm05"){
var cur = new Date();
if(tvmslist.length>0){
alert("At this time " + cur +" Run");
}
setTimeout("runText()", 60000);
}
}
With above code, if I modify the TVMS.txt it still using old content (be stored in session variable). So I want to remove the attribute of all online session when I update the text file.