Solved

code for logo placement on website

Posted on 2006-06-19
14
361 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
  • 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:mayankeagle
mayankeagle 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
 
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 30

Expert Comment

by:mayankeagle
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:mayankeagle
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:mayankeagle
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:mayankeagle
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:mayankeagle
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 2 42
IT Company 5 69
unix in java example 9 43
HSSFWorkbook cannot be resolved error 10 23
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now