i m developing a customized e-shop.i have added a photo in the album and i want to show it directly on profile photo automatically,how to do this?
Please post with more details.
Guessing around what you have posted, you have uploaded a photo and the photo is now successfully stored in the DB. So the real problem now is that when you open the profile page, the photo also needs to be displayed. Is that correct?
What I would do in this scenario is this:
1. Get the photo from the DB along with the other details about the profile. Store this in some bean/hashmap under some key.
2. Write an image servlet. The servlet takes an image key as a request parameter and accesses the session to get the image byte from the bean/map in session. The byte will be written to the response stream after setting the content type as image/gif ( or whatever be your format ).
3. Render the profile html page with an image tag with src attribute pointing to the image servlet with the correct image key.
Will this solve your problem?