I have a Java string containing HTML/JS/CSS code like this (very simple example):
<div>Welcome</div>
<style type="text/css">
.title{
color:red
}
</style>
<script type="text/javascript">
var i=0;
for (i=0;i < 5;i++){
document.writeln("<div class='title'>" + i + "</div>");
}
</script>
I receive that string on the Java side.
What I want is to "render" that string as it will be displayed on the browser.
So, I want to obtain the following result on my Java side :
Welcome
0
1
2
3
4
Is there a method like this ?
String renderedHTMLJS = therenderingmethod(htmljsString);
How can I do this ?
Thank you
Java to evaluate that string? What op you want?document(I think)