• 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

Servlet and Applet communication

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello ,
I am using an applet with two panels one containing the Gui components .The other panel is kept blank and supposed to display images depending upon the values entered by the user in GUI components in the panel .
The display of images should be from server . I need to have applet servlet communication for it . well can somebody suggest me how to send images (GIF/JPEG) display images to an Applet from servlet after mataching in database .
I have done servlet applet communication using text data .well i am using javawebserver 2.0 .
Any help in this regard will be appreciated
regards
mani

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most books on servlets, including mine, have chapters on sending images, sounds, etcetc. The main points you have to watch:
1. Use an OutputStream rather than a Writer
2. Set the content-type in the response with setContentType
3. Set the content-length with setContentLength
4. write the bytes to the stream and close the stream
(Strong-hint) Drop the use of Java WebServer and switch to Tomcat. You will have to some time since JWS is no longer supported, might as well do it now.(/Strong-hint)
Bill

------------------
author of:
 
mani suri
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
Thank you william for your suggestion regarding tomcat . I will definately go by the you suggested .
thanks once again
mani
 
reply
    Bookmark Topic Watch Topic
  • New Topic