Solved

code for logo placement on website

Posted on 2006-06-19
14
364 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 168 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 166 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 35

Assisted Solution

by:girionis
girionis earned 166 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
ejb mdb examples 1 21
Crystal Reports Licensing Questions 4 63
Java basic valueOf question 1 34
Running JavaFX on the Raspberry Pi 27 141
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

726 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