Cool. What exactly does the webserver output? Can you modify the server script? An AJAX solution would be great for this, but maybe a little bit too complicated. You'd have to process a GET/POST request, which really could be as simple as 2 lines of code, but i don't know JSP, so you tell me.
This is simplified version of my first suggestion and the setTimeout is there just to reload the page every 500ms automatically:
<!DOCTYPE html>
<html>
<head>
<script>
function updateStatus( pString ) {
document.getElementById( "status" ).childNodes[ 0 ].nodeValue = pString;
}
window.onload = function() {
setTimeout( function() { window.location = window.location; }, 500 );
var amountLoaded = parseInt( document.getElementById( "demo" ).childNodes[ 0 ].nodeValue, 10 );
if ( amountLoaded === 100 ) {
updateStatus( "done :-)" );
} else {
updateStatus( amountLoaded + "%" );
}
document.getElementById( "progressBar" ).setAttribute( "value", amountLoaded );
};
</script>
<title>Progress</title>
</head>
<body>
<p>the incoming dynamic data is :</p>
<p id="demo">%! port-adc2</p>
<progress id = "progressBar" max = "100" value = "0"></progress>
<span id = "status">0%</span>
</body>
</html>
You could even get rid of the setTimeout line and use the Refresh meta-tag:
<meta http-equiv = "refresh" CONTENT = "1;URL=file://localhost/progress.html">
just replace the "file://localhost/progress.html" with whatever is in your adress bar when you want to access the webserver. However, you are limited to whole seconds with this approach. But i believe, that you could get rid of all the javascript (i hope noone reads this, since it is a javascript forum). Try this:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv = "refresh" CONTENT = "1;URL=file://localhost/progress.html">
<title>Progress</title>
</head>
<body>
<p>the incoming dynamic data is :</p>
<p id="demo">%! port-adc2</p>
<progress id = "progressBar" max = "100" value = "[COLOR="#FF0000"]%! port-adc2[/COLOR]"></progress>
<span id = "status">[COLOR="#FF0000"]%! port-adc2[/COLOR]%</span>
</body>
</html>
I am not sure if JSP will replace the content inside quotes, but if yes, we have the simplest solution ever 