• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to print

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah ....It is possible to print in servlets.......try using PrintWriter class.
 
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Author
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for everybody given valuable information
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic