I am maintaining a console log on my web page to display errors/exceptions and success cases as shown below
So once the user selects valid files and uploads them, a servlet uploads files and returns uploaded path to the console like this
As you can see in my second image the console is also refreshed loosing all the previous messages, I don't want this to happen. How do I do this?
I am populating the div tag with holds the console as follows from JS
else if(FileName1 == FileName3 || FileName1 == FileName4 || FileName2 == FileName3 || FileName2 == FileName4)
{
var err1 = document.getElementById("box");
err1.innerHTML = "Configuration file and Geco script should not be the same as left or right files. Please check your uploads";
err1.style.color = "Red";
}
//else if(FileName1.value)
else
{
var scc1 = document.getElementById("box");
scc1.innerHTML = "Uploading files, the page might refresh";
scc1.style.color = "Blue";
document.myform.submit();
}
the the DIV tag which holds console gets values from servlet as follows
<div id="box">${f1stat}<br>${f2stat}<br>${f3stat}<br></div>
Servlet sends response as follows,
String f2 = "Uploaded file " +fileName+ " at " +uploadedFile.getAbsolutePath();;
request.setAttribute("f2stat", f2);
RequestDispatcher rd = request.getRequestDispatcher("geco.jsp");
rd.forward(request, response);
Finally, all I want to do is to avoid console refresh so that it will not loose its message history. How to do this?