wood burning stoves 2.0*
The moose likes Servlets and the fly likes How to print Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to print" Watch "How to print" New topic
Author

How to print

Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
How to print on the server side or on the client side using java servlets .Is it possible to print either client or server side using servlets
Jabez Justin
Greenhorn

Joined: Jan 21, 2003
Posts: 1
Yeah ....It is possible to print in servlets.......try using PrintWriter class.
Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
To print at clientside(using printer and not on console) u have to use window.print() method of javascript. You can not invoke client's printer using servlet.
[ January 21, 2003: Message edited by: Prakash Dwivedi ]

Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Marty Hall
Author
Ranch Hand

Joined: Jan 02, 2003
Posts: 111
Is it possible to print either client or server side using servlets

Well, of course "servlets" cannot do anything on the client, since they do not run on the client. But, of course servlets can output (or refer to) normal Web content like HTML, JavaScript, or VBScript. The fact that JavaScript is generated by a servlet (or referred to by an HTML page that is generated by a servlet) does not change in the slightest what it can do on the client. The client does not know the difference.
Sure, a servlet could print on the server. But I can't see what good that would do anyone. Presumably the client has no access to the server machine.
Cheers-
- Marty


Java training and consulting
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
To print on the client side, the user needs to use the mouse click.
Servlet can generate all kinds of printable files (pdf, html, Word, image etc.) and send to the user.
Maybe it is possible to have servlet send output directly to a printer instead of a browser.
Just a thought.


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
Thanks for everybody given valuable information
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to print
 
Similar Threads
What is the need for an applet?
Printing a server file to client side printer
Difference between servlets & Applet
How can I print?
can applications access servlets?