Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which method to use ?

 
Gautham Venkataram
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I am new to Java and I have this project where I have to read output from a server program and correspondingly change the images that are displayed. What method do I use ? Thanx in advance.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that the HTML page that shows the images is unchanging, you need a servlet that can respond to the image requests.
<img src="http://someserver/servlet/imagemaker?imgid=someid">
This will require you to write a doGet method that can pick up the id and serve up the image. Note that when serving images you have to set the content type and content length.
Serving custom images is covered in most Servlets books, (including mine).
Bill

------------------
author of:
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic