« Return to Thread: Re: Trails question

Re: Trails question

by Kalle Korhonen-2 :: Rate this Message:

Reply to Author | View in Thread

Please use the Trails users mailing list when asking questions about the framework. So, you got your image bytes in the database, then what? I assume you want to show the images on the table. If so, you'd override the columnvalue for Picture property (http://www.trailsframework.org/Customizing+pages

, "Customizing ObjectTable component") and you'd render an img tag and its src link instead (with a value something like /pictureservice?id=XX). Then, you'd implement a simple Tapestry service that finds the right entity based on the given id and returns the image stream.

The 64K is a database-specific default for a lob field. You can set a different size with a Hibernate annotation, e.g. @Column(length = 1048576)

Kalle


On Sun, Oct 26, 2008 at 4:44 AM, TC2 <tim.cave2@...> wrote:
Hi - I love the trails framework! At last I can build webapps without ten miles of code.....
 
I want to add pictures to my app and have got as far as this:
 
private byte[] picture;

@PropertyDescriptor(index= 2,displayName="Pic")

@Lob

public byte[] getPicture() {

return picture;

}

public void setPicture(byte[] picture) {

this.picture = picture;

}

How do a get the picture to display on the page?....and get over the 64k limit??

Many thanks in advance.....

Cheers TC

 

 


 « Return to Thread: Re: Trails question