Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
Java
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:

C#
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);
    }
}

JavaScript



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.
Posted
Updated 20-Apr-14 17:21pm
v2
Comments
baliram bhande 18-Apr-14 5:53am    
please see your code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900