This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes start stop image Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "start stop image" Watch "start stop image" New topic
Author

start stop image

zita lakshmi
Ranch Hand

Joined: Nov 13, 2009
Posts: 37
hi sir,
i want to set the image according to the status which is getting from the database.
I've written the jsp coding as



<td></td>
<td class="style7" style="width: 108px"><strong>Campaign Image</strong>
<c:forEach var="campaignimage" items="${image}"><br/>      
<cut value="${image}">
</cut>
</c:forEach>
</td>

while executing this page it is showing like this

[com.mysql.jdbc.Blob@bf1d3b, com.mysql.jdbc.Blob@118278a, com.mysql.jdbc.Blob@cc0e01]
[com.mysql.jdbc.Blob@bf1d3b, com.mysql.jdbc.Blob@118278a, com.mysql.jdbc.Blob@cc0e01]
[com.mysql.jdbc.Blob@bf1d3b, com.mysql.jdbc.Blob@118278a, com.mysql.jdbc.Blob@cc0e01] .


sir can you please solve this problem and send the required coding it's very urgent.
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
Sir, how is this related to Spring?

You should have a servlet that retrieves the image from the DB based on an id passed in as GET parameter, for instance, and writes the data of the image (Blob.getBytes()) to the client. And in the JSP you just reference this servlet:



OCJP 6 (93%)
Henry Mbadiwe
Greenhorn

Joined: Feb 09, 2010
Posts: 4
First, could you disable smilies in your post?
Second, do you have anything else underlying this web page you're trying to display (applicationContext.xml for example, *-servlet.xml, *-service.xml, Controller classes)?
Maybe if you post those things we'll be able to help.
zita lakshmi
Ranch Hand

Joined: Nov 13, 2009
Posts: 37
Hi

Thanks for your reply. I have used the following code in controller,



Here is the jsp code:


I got the result as,

Campaign Image
[com.mysql.jdbc.Blob@afae4a, com.mysql.jdbc.Blob@1db9852, com.mysql.jdbc.Blob@1ed5459]
[com.mysql.jdbc.Blob@afae4a, com.mysql.jdbc.Blob@1db9852, com.mysql.jdbc.Blob@1ed5459]
[com.mysql.jdbc.Blob@afae4a, com.mysql.jdbc.Blob@1db9852, com.mysql.jdbc.Blob@1ed5459]

please help to retrieve this problem,its very urgent.
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
Zita, have you seen my post..? Have you tried to implement it?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56183
    
  13

JSPs create HTML. Do you show in image in HTML by including its bits in the page? Of course not. Think!

You use an <img> tag as Lorand has shown.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: start stop image
 
Similar Threads
hi
can we give id to path variable ?
Iframe to automatic update in jsp according to the database
jsptags paging question
Redirecting a page