Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Applet and DHTML / DOM

843807Mar 26 2004 — edited Mar 30 2004
To provide context and user dependent HTML code in a web browser, I have a JavaScript based DHTML / DOM solution, which heavily relies on "document.write(variable HTML code)". This call pumps the generated text directly in the browser context and is interpreted by the browser just as normal HTML code of the web page.

I need now to provide a Java based solution in form of an applet, which runs on browsers with JavaScript completely turned off for security reasons. So, there is no possibility to transfer the generated code to JavaScript and from there to the browser. System.out. goes to the console, wrong stream. I need full HTML functionality, not only rendering as in JEditorPane, where e. g. hyperlinks won't work.

The needed transfer functionality is is defined in DOM by W3C. Unfortunately, the 'write'-method of 'document' analog to the JavaScript-method isn't in the org.w3c.dom package of the Java API (why?).

What is the solution? Additional components like proposed in the O'Reilly Java Cookbook?

Thanks in advance
Keye

(A similar, but shorter question was already posted in 1999:
http://forum.java.sun.com/thread.jsp?forum=5&thread=7058
but with no replies. Other postings got replies recommending redirections on JavaScript)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 27 2004
Added on Mar 26 2004
1 comment
157 views