Solved

Creating HTML page from applet on the fly

Posted on 1997-08-30
2
157 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 3 50
Java SE 8u111  Lot of stuff broke 11 52
map related example 6 29
difference of if loops 23 37
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

932 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

10 Experts available now in Live!

Get 1:1 Help Now