Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to print

 
Graham Thorpe
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah ....It is possible to print in servlets.......try using PrintWriter class.
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Marty Hall
Author
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Graham Thorpe
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for everybody given valuable information
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic