Doubt in JSP
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sujatha_Kumaran
Posted On:   Wednesday, February 26, 2003 12:15 PM

Hi



I need to show the Image as well as some data related to that Image in JSP.Image and their related data's are stored in database.



Because both the content type are different also i dont know how to show the different content type in single request?



How can i show both the data [Image and Text] together.



Thanks,

Sujatha Kumaran

Re: Doubt in JSP

Posted By:   vinay_salehithal  
Posted On:   Wednesday, February 26, 2003 01:17 PM

There may be better ways of doing this, but one way is to


1. Retrive the resultset, convert this into a results object and place into session.

2. Servlet(with html contenttype) will create a table, after getting the textual rows from this object.

3. The image column cd be populated with an html image element with its src pointing to either the same servet or another servlet(this will have contenttype=image), which will send back the image, as it also has access to data from the session.

Re: Doubt in JSP

Posted By:   Joe_Millionaire  
Posted On:   Wednesday, February 26, 2003 01:08 PM

You are correct, you can not do both.

Use a Servlet to stream or write a Class to write the image to disk.

Use JSP to call the Servlet or point to the location your class wrote the image to. Use some inline logic to display the associated data for the image.
About | Sitemap | Contact