This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Which method to use ? 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 "Which method to use ?" Watch "Which method to use ?" New topic

Which method to use ?

Gautham Venkataram

Joined: Jun 05, 2001
Posts: 2
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

Joined: Mar 22, 2000
Posts: 12761
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).

author of:
subject: Which method to use ?
Similar Threads
Refresh Jtable went you press update button
URL rewriting in Struts1
CachedRowSet with JSF
How to configure Factory Method in spring 2.0