Solved

Creating HTML page from applet on the fly

Posted on 1997-08-30
2
152 Views
Last Modified: 2010-04-16
Hi!
I want to create a new HTML page from my applet on the fly but I'm not exactly sure how to do it.
On this HTML page I want to have another applet which uses data from the other applet.
Is this possible ??? If it is, then how can I do it ???

Yours sincerely
 Tomas Helgi Johannsson
0
Comment
Question by:Tomas_Helgi
2 Comments
 
LVL 4

Accepted Solution

by:
russgold earned 30 total points
ID: 1226031
What you are asking for is not impossible, but...  The problem is that applets are generally not permitted to write files of any kind (including HTML files).  In browsers that permit it (such as HotJava, you can choose to "trust" a signed applet and allow it to write files. In JDK 1.2, you may even be able to allocate a specific directory for applets to write to.  Of course, all of this is dependant on the browser.  Current browsers generally do not permit this.

On alternative is to have a server process, accessed via RMI, CORBA, or sockets, create the file for you on the server.

Once you have managed to create the new file, you can use the Applet.showDocument() method to invoke it.

You can have the new applet use data from the launching applet by passing the data as parameters in the <APPLET> statement.
0
 

Expert Comment

by:gagnonr
ID: 1226032
You can construct in JAVA the HTML and call a JAVASCRIPT to create the HTML "on-the-fly". Look at my site
  http://www.geocities.com/SiliconValley/Vista/1337
in the JAVASCRIPT-JAVA interaction How-to section for a
snippet. Of course that solution is Ok with Netscape or IE4
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now