Discussions

Web tier: servlets, JSP, Web frameworks: Rendering the image in a web application

  1. Rendering the image in a web application (4 messages)

    Hi, I'm receiving an encoded image from a webservice. I need to decode it and display it in the JSP. I have the decoding logic in place (its base 64 one). With every request, a fresh image will be created. To display the image in the JSP, I need to have the decoded image in the server and in JSP I need to point to the location where it is stored. Just wanted to know if there is any better way. Also, I don't want to load the server with images, so I need to have a thread to delete those images at regular intervals. Suggestions on naming the image file are welcome, to make sure that there's no duplication and the right image is rendered to the user. Thanks very much in advance.
  2. Solution #1: You can put the image stored as byte in session. You will have a controller that is designated to send this image in bytes when it is requested from the JSP. Solution #2: You can put this image on local storage like temp folder. Then you this image by generating the URL. Solution #3: Store the image in database so you don't have to worry about naming convention. Once you retrieve this image from database you delete it immediately so you don't need to have a separate thread to delete it.
  3. Hi, First solution looks better in me in this case case. Is any way to pass the image bytes to the servlet (or JSP) without using the session?
  4. See for example Temp objects taglib in Coldtags suite: http://www.servletsuite.com/jsp1.htm
  5. hi,i have the same requirement,could you please help me out how to start with.