Meaningless Drivel is fun!*
The moose likes JSP and the fly likes How to get text file printed in Java program or From JSP page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to get text file printed in Java program or From JSP page?" Watch "How to get text file printed in Java program or From JSP page?" New topic
Author

How to get text file printed in Java program or From JSP page?

Rushi Patel
Greenhorn

Joined: Sep 14, 2011
Posts: 17
I want to perform billing functionality.

In which i have displayed bill on screen but now further i want to store that same in the database and that will be achieved.
Next i want to write it in TXT file and want to get that file printed.

I will manage to write the same data into that file but How to PRINT that file from my Printer in LAN through JSP Page or any JAVA program??

Any help regarding this will be appriciated...!

Thank you.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Printing -like any file I/O or DB access- should never be done in a JSP, but from a servlet or backing bean. This should help: http://docs.oracle.com/javase/tutorial/2d/printing/index.html
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

do you want the user to print it on their printer, or it to appear on the servers printer?


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get text file printed in Java program or From JSP page?