aspose file tools
The moose likes JSP and the fly likes how to display image with data in jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "how to display image with data in jsp page" Watch "how to display image with data in jsp page" New topic
Author

how to display image with data in jsp page

sudarshan jadhav
Ranch Hand

Joined: May 28, 2012
Posts: 41
Hello everyone,
How to display image and there related database value display in jsp page
I have error in tomcat is
Only show image from database but related database record value is not show on jsp page


My Jsp file is as follows
SelectCustomer.jsp


My servlet code is as follow:
GenerateBill.java



And i have genrate a bill to next jsp page

ViewBill.jsp

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 927
    
    2

Hi sudarshan,
Please CarefullyChooseOneForum before you post. This forum is for questions about Swing and not JSP/Servlets.

I am moving this post to the JSP forum where you can get the right responses.

Note that, we also have a forum for Servlets

Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56232
    
  13

A JSP is just a template for an HTML page. And in HTML <img> tags are used to display images.

What does that tell you about the approach that you are using?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
sudarshan jadhav
Ranch Hand

Joined: May 28, 2012
Posts: 41
Thank you Bear for reply
I want to display image and database value on jsp page but only image is display on jsp page please give me one example which show image and value from database to jsp page
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56232
    
  13

Once again, you don't show an image on a JSP; a JSP is just a template. You show the image in the HTML page that is generated from the JSP with an <img> tag. That means that the image tag had to be able to use a URL to get the image data. Passing the image data to the JSP itself is not useful. Write a servlet that sends the image data separately.
Rajkumar Angare
Greenhorn

Joined: Dec 23, 2012
Posts: 3
Hello,

This is not good way to store image in DB, store image into file system, and store image url into DB, get image url from DB and

String imageURL = rs.getString("ImageURL");

I JSP <img src="<%=imageURL%>" ......

try with this.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to display image with data in jsp page
 
Similar Threads
Paging in jsp
Unable to find specific product
How to create displaytag table border
Client side validation not working
fixed header, problem with alignment, must support all browsers