Solved

How to create dynamic html in java applet

Posted on 1998-01-26
2
217 Views
Last Modified: 2012-06-27
Env. VJ++ 1.1 JDK 1.02 netscape 3.01
Hi there,
 
     I am interested in printing a report from my java applet with the current data. I know that JDK 1.02 does not support printing. So what I am planning to do is create a temporary html with the data dynamically and tell user to print the html file from browser. My question is how to create a temporary dynamic html from applet? Can somebody give me some clue or better solution?

Maha
 
0
Comment
Question by:maha
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 20 total points
ID: 1232593
As you know already, a Java applet can't print (under 1.02) nor will IE or Navigator properly print data displayed inside an applet.  They just don't know how to render the data and the applet can't render itself because the JDK doesn't support it.  You also can't have the applet send HTML to the browser since that violates the Java security model.  So, how can you do it?

This is what I have done.  Have the applet structure the HTML like you want it and send it back to a CGI program on the server.  The applet can then request the page back from the server and tell the browser to display it.  You can then have the server cgi program delete the temporary page after it's been displayed.  If this seems like a runaround, I agree, but these are the kind of tricks that must be played to work around the "sandbox" in Java.
0
 

Author Comment

by:maha
ID: 1232594
Hi jhance,

    That sounds good. But I am pretty novice to CGI programming. Can U give some sample code or some pointers to books or sites, I would really appreciate.

Thanx
Maha

0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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 video teaches viewers about errors in exception handling.

770 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