473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Render HTML with embedded JavaScript.

1
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.
Sep 17 '08 #1
1 2999
Could you post your code of which is suppose to render the HTML? That will help me understand your issues better.

thanks

John M.

MS Technology
http://www.ms-technology.com
Sep 17 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Paul Thompson | last post by:
In NN/FF/Moz, it takes 20 sec to render a page from a file of 330 KB. It takes less than 1 sec to render that file in IE. Is there some tweak that I can make on NN to alter this? The...
6
by: vandalo | last post by:
Hi all I developed a service which can convert an office document (word, excel, powerpoint into HTML and save it on the file system To do this I use the "save as" functions of the office...
2
by: Ronen | last post by:
Hi, I am writing a grid Web control library. The grid has some client side JavaScript to enable columns resize, sorting, row selection etc. I have some problems adding the JavaScript...
4
by: Zuel | last post by:
Hi Folks. So I have a small problem. My DoPostBack function is not writen to the HTML page nor are the asp:buttons calling the DoPostBack. My Goal is to create a totaly dynamic web page where...
2
by: Frank | last post by:
From: "Frank" <fkaesser@pfmail.com> Subject: Can I Use HTML Text Writer i a Custom Control to Render the <head> Section? Date: Wednesday, January 18, 2006 11:38 AM I would like to create a...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
0
Coldfire
by: Coldfire | last post by:
i want to know in detail the functionality of this Page class Event ! What triggers this fucntion after Postback event etc.. protected override void Render(HtmlTextWriter writer) {...
1
by: Wepic | last post by:
render :update returns js wrapped in a HTML body Hi. From what I'm learned the below is suppose to return "alert('Im JS');" to the javascriptGenerator that's suppose to make the page scream...
42
by: Santander | last post by:
how to decode HTML pages encoded like this: http://www.long2consulting.com/seeinaction2008/Simplicity_Beach_table/index.htm Is there script that will do this automatically and generate normal fully...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.