Hi,
This can be done with the help of the data output stream and
bufferedWriter. But the thing is that you need to write the whole code for
this in to a dataoutput stream( just like a servelet). Each time concatenate
the data you want to write in to the file and write that . Put this in a jsp
file and call that on click of the button. You can store that file in the
hard disc too, by giving the Output stream file name, xyz.html, in this
case. Some part of the code is given below.
DataOutputStream dos = new DataOutputStream(new java.io.FileOutputStrea
("d:\\geladkfiles\\xyz.html"));
BufferedWriter bos = new BufferedWriter(new java.io.FileWriter("xyz.html"));
dos.flush();
dos.writeBytes("<html><head><style>TABLE { background-color :#FFFFE0;}\nBODY
{ font family :Tahoma; font-size : -7%;}\n");
For writing the data value, you can use the folowing syntax,
dos.writeBytes("<input type='text' readonly value='"+dateInitiated+"'
name='dateinit'></TH></tr><tr>");
Hope this helps you
Santosh kotnis.
"The beauty of life does not depend on how happy you are but on how happy
others can be because of you"
=========================================================
Santosh Kotnis
GE Lighting (PDM Group )
Tata Consultancy Services.
185, Lloyds Road
Chennai- India.
URL: http://www.geocities.com/santosh_kotnis
=========================================================
----- Original Message -----
From: ramanathanp <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 18, 2001 8:30 AM
Subject: HELP !!! Printing from HTML document...
> hi,
>
> I need to print the contents of an html page on the click of a button
> (print). Is there any way to do it in JSP/JavaScript/HTML...
> I also need to save these contents to a file (on hard disk) on click of
save
> button. are there any APIs available for it ????
>
>
> TIA
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets