Hi All, I want to dynamicaly create a image depending on the user logging in and is resource consumption, but i don't want to store the image in any temporary location, but it must be part of the dynamic html contetnt the user is viewing. The image won't be reused. Could anybody guide me on this.
Yes, but I don't have any sample code on me. Basicaly you write a servlet which accepts requests for images, dynamically generates one based on the user information, then encodes and streams it directly to the user. Nothing is stored locally.
Look for link to addressbook in my signature. You will find class Challengeimage in sources. This class dynamically produces an image and display it on page. I use a front controller pattern, but you can consider this class as a servlet.
Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Servers don't send text and images in one response. Send the HTML with an image tag. The browser will create a new request for the image and assemble the page.
"Siva J" Please change your display name back or your account will be deleted. Please don't play around with display names, we take them very seriously.
The servlet will return the image, so just link to the servlet in the image tag. The browser will send a separate request to load the image from the Servlet.