[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

code for logo placement on website

Posted on 2006-06-19
14
Medium Priority
?
369 Views
Last Modified: 2008-03-06
I have website that displays thousands of products.

The site is written in .jsp and I would like a code implemented so that each time a product is displayed the manufacturers logo would appear.


For expample if a Toshbia product is selected then i would like a toshiba logo to display with it.
 http://www.ota.com.au/catalogue/details.jsp?productID=5606&tier4=16875&tier3=16870&tier2=16949&tier1=16944&type=vendor

Thanks


0
Comment
Question by:Adamylo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
14 Comments
 
LVL 7

Accepted Solution

by:
dttri earned 672 total points
ID: 16939534
Greetings,
What does your database structure look like? I think the easiest way is to store Manufacturer information along with their logo (eg, a string point to an image) in a table, and in the product table there is an additional field which describe who manufacture it. So when you display a product you can know its' manufacturer and display their logo accordingly.
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 664 total points
ID: 16939923
Yes, the image can be stored in the DB or a link to the image can be stored in the DB (in the same table which stores master info about the product). In your JSP, you can display the image by simply using the <img scr=""> tag and replace the src with the image URL. If you want to store the entire image in the DB, it can be retrieved this way:

http://www.javaalmanac.com/egs/java.sql/GetBlob.html
0
 
LVL 35

Expert Comment

by:girionis
ID: 16940119
I think it would be better to store the image on the disk and store the path to the image in the database. By doing this you wouldn't have to store all the binary data in the database and it would be faster to read it from the disk anyway.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Assisted Solution

by:girionis
girionis earned 664 total points
ID: 16940128
And here is some info on how to read the image from the disk: http://javaalmanac.com/egs/javax.imageio/BasicImageRead.html
0
 
LVL 35

Expert Comment

by:girionis
ID: 16940136
Although, on second though, you probvably won't need it since the browser can read the images from disk traight away.
0
 
LVL 7

Expert Comment

by:dttri
ID: 16940193
>>Yes, the image can be stored in the DB or a link to the image can be stored in the DB (in the same table which stores master info about the product)

Please correct me if I'm wrong. I think the link to the logo image should be stored in the manufacturer table which is different from the product table. Because there is a one to many relationship between manufacturer and product, and "logo" is an attribute of manufacturer not product (as in the question of Adamylo).
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16940218
It depends upon what image has to be displayed. If its the manufacturer logo - yes it should be stored with the manufacturer master info. If its an image for the product (like a different image for Toshiba laptop version xyz and Toshiba laptop version abc) then it should be with the product.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16940225
>> I think it would be better to store the image on the disk

Not on the client side, right? Otherwise it will be expected that all clients have a copy of the images, and moreover they need not even have Java. Its easier to host the images in the web-server within the context-root of the application and just give a link to it (like we do for normal images in a JSP application), so that the browser can directly download it.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16940232
>> I think it would be better to store the image on the disk

Not on the client side, right? Otherwise it will be expected that all clients have a copy of the images, and moreover they need not even have Java. Its easier to host the images in the web-server within the context-root of the application and just give a link to it (like we do for normal images in a JSP application), so that the browser can directly download it.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16940235
>> I think it would be better to store the image on the disk

Not on the client side, right? Otherwise it will be expected that all clients have a copy of the images, and moreover they need not even have Java. Its easier to host the images in the web-server within the context-root of the application and just give a link to it (like we do for normal images in a JSP application), so that the browser can directly download it.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16940248
Sorry for multiple posts - I got Page cannot be displayed and had to refresh :-(
0
 
LVL 35

Expert Comment

by:girionis
ID: 16940259
>> I think it would be better to store the image on the disk
>
>Not on the client side, right?

No, on the server, probably somewhere in the web app tree (if the images are only related to web application).
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question