Greetings Everyone!
I am working on a Java application where I have to develop a Swings client which talks to a web-server. The client sends the HTTP get request for a specific resource which it receives as HTML and uses JEditorPane to render the HTML.
The overall architecture is like I have a HTML request processor thread which connects to a particular URL and GETs the resource. The resource is a "String" which contains the HTML. Now is user the setData() method of the JEditorPane.
The problem that I am facing is that the HTML that I receive from the server contains some portions of embedded JavaScript. So, the logical approach is to run through the javascript and pass on the final HTML to the setData() method of the JEditorPane component.
Now, I need to figure out a way to execute this embedded JavaScript. If someone can help, I'd be really greatful.
Please do not direct me towards the Web URLs of "javax.script" API in JDK 6 or the Mozilla's Rhino API. I have already been through that and nothing seems to be working in my case because they can execute absolute JavaScript but not the individual portions embedded in an HTML page.
And, btw, I am using JDK 6 for the development here.
Thanks in advance.