You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Miroslav F." <mi...@seznam.cz> on 2011/07/10 15:44:28 UTC

url for images from database

Hi folks,

please direct me to right docu with following problem: I have image as
byte[]
from database which I display on pages.

Works fine, on image atribute src is somethink like this:
<img src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/>

For lightbox I need make this "ugly" src atribute transform to something
like src="/images/xxx.jpg" and mount it on-the-fly but don't know how to do
it.

Is somewhere related example please?

Thanks in advance,

Miro


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: url for images from database

Posted by eugenebalt <eu...@yahoo.com>.
This works for me, in case anyone's interested in a simple solution.

I have a ListView which outputs Books (their Title, Author, etc., and also a
Book Image which is a JPG stored in a DB), all per row, based on a POJO
called "Book" which stores all this info. "Book" also has a byte[] for the
Image field.

        add(new ListView("books", books) {

            @Override
            protected void populateItem(ListItem li) {
                Book b = (Book) li.getModelObject();
                li.add(new Label("bookId", b.getBookId().toString()));
                li.add(new Label("bookTitle", b.getBookTitle()));
                li.add(new Label("bookAuthors", b.getBookAuthors()));
                li.add(new Label("bookPrice",
Integer.toString(b.getBookPrice())));
                // add book image
                ByteArrayResource resourceBookImg = new
ByteArrayResource("image/jpeg", b.getBookImg());
                TechBooksApplication.get().getSharedResources().add("img" +
li.getIndex(), resourceBookImg);
                Image imgBook = new Image("bookImg", resourceBookImg);
                li.add(imgBook);

            }
     });


Maybe this isn't quite what Miroslav wants, but for me I don't need to
re-format URLs, so this is working fine for me.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-tp3657615p3700046.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: url for images from database

Posted by eugenebalt <eu...@yahoo.com>.
I guess my question is a little simpler than Miroslav's because I don't need
to modify the URLs. I don't need to mount anything. I just need a dynamic
image display from a byte[], I don't care which URL Wicket uses.

How can I construct a DynamicImageResource from a byte[], and give it to the
Wicket Image component?

Thanks

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-tp3657615p3699594.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: url for images from database

Posted by Martin Grigorov <mg...@apache.org>.
Fresh new description how to do that in Wicket 1.5:
http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/

On Tue, Jul 26, 2011 at 3:38 PM, eugenebalt <eu...@yahoo.com> wrote:
> I have the exact same problem. I have Images coming from the DB, along with
> other stuff, and I need to display them, per row, as   , similar to how
> Amazon.com lists their books next to book title, etc.
>
> Is there an easy way to do it? Very common problem. Can someone show what
> the HTML and Java should look like to support this dynamic image display?
>
> Thanks
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-tp3657615p3695546.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: url for images from database

Posted by eugenebalt <eu...@yahoo.com>.
I have the exact same problem. I have Images coming from the DB, along with
other stuff, and I need to display them, per row, as   , similar to how
Amazon.com lists their books next to book title, etc.

Is there an easy way to do it? Very common problem. Can someone show what
the HTML and Java should look like to support this dynamic image display?

Thanks

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-for-images-from-database-tp3657615p3695546.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: url for images from database

Posted by "Miroslav F." <mi...@seznam.cz>.
No one has experience with LightBox/Slimbox/Shadowbox/Other? How do you
implement
same src (in <img>) and href (in <a>) attributes to make it works?

> -----Original Message-----
> From: Miroslav F. [mailto:mirfok@seznam.cz] 
> Sent: Monday, 25. July 2011 21:55
> To: users@wicket.apache.org
> Subject: RE: url for images from database
> 
> Thanks, was looking on classes :-)
> 
> Now I have code:
> 
> HTML:
> <div style="	border: 1px solid #DCD4A7;
> 			float: left; position: relative;
> 			width: 207px; height: 340px;
> 			margin-top: 5px; margin-right: 20px; 
> margin-bottom:
> 10px;">
> 	<a	href="#" wicket:id="anchor"
> 		rel="zbox"
> 		title="">
> 			<img	style="border: 3px solid 
> #DCD4A7; padding:
> 1px 1px 1px 1px; width: 199px; height: 149px;" alt="" src=""
> 					wicket:id="image">
> 	</a>
> 
> Wicket:
> DBImage image = new DBImage();
> image.setImageData((byte[]) dataFromDB.get(dataOffset));
> 
> //not to cache images in browser
> Double random = Math.random();
> 
> //put image into shared resources
> Start.get().getSharedResources().add("image"+((String)
> dataFromDB.get(textOffset)) + random.toString() + ".jpg", 
> image); ResourceReference imageResource = new 
> ResourceReference("image"+((String)
> dataFromDB.get(textOffset))+ random.toString()+".jpg"); 
> String url=RequestCycle.get().urlFor(imageResource).toString();
> 
> //make "href" in "a" and "src" in "img" point to the same 
> location for zbox to make work ExternalLink odkaz = new 
> ExternalLink("anchor", url); WebMarkupContainer 
> imageSrcAttribute = new WebMarkupContainer("image"); 
> imageSrcAttribute.add(new AttributeModifier("src", new 
> Model<String>(url))); odkaz.add(imageSrcAttribute); 
> odkaz.add(new SimpleAttributeModifier("title", (String) 
> nazvy.get(i)));
> 
> this.add(odkaz); 
> 
> 
> This works, not know if code is good from point of right way 
> to do this in wicket..
> 
> Miro
> 
> 
> 
> > -----Original Message-----
> > From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> > Sent: Thursday, 14. July 2011 18:11
> > To: users@wicket.apache.org
> > Subject: Re: url for images from database
> > 
> > look at the very bottom of that page....
> > 
> > -igor
> > 
> > On Thu, Jul 14, 2011 at 6:50 AM, Miroslav F. 
> <mi...@seznam.cz> wrote:
> > > Still be lost :-(
> > >
> > > This code I have in AppStart class:
> > > mountSharedResource("/images/image1.jpg", new 
> > > ResourceReference(Images.class,
> > "image1.jpg").getSharedResourceKey());
> > >
> > > Now after reading recomended example still not idea how to
> > replace new
> > > ResourceReference(... in above code snippet in a way in 
> which I get 
> > > from byte[] shared resource key.
> > >
> > > Please be kindfull, I'm in low level in java and greenhorn
> > in wicket
> > > :-D
> > >
> > > Miro
> > >
> > >
> > >
> > >> -----Original Message-----
> > >> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> > >> Sent: Tuesday, 12. July 2011 17:09
> > >> To: users@wicket.apache.org
> > >> Subject: Re: url for images from database
> > >>
> > >> https://cwiki.apache.org/WICKET/uploaddownload.html
> > >>
> > >> -igor
> > >>
> > >> On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. 
> > <mi...@seznam.cz> wrote:
> > >> > Is there example? How to get shared resource key from
> > byte[] (image
> > >> > from DB)? In my App class i do for several shared resources:
> > >> > mountSharedResource("/styles/style.css", new 
> > >> > ResourceReference(Styles.class,
> > >> "style.css").getSharedResourceKey());
> > >> >
> > >> > Is is possible in this code getsharedResource() for byte[]
> > >> (image from
> > >> > DB) in some way?
> > >> >
> > >> >
> > >> >> -----Original Message-----
> > >> >> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> > >> >> Sent: Sunday, 10. July 2011 18:16
> > >> >> To: users@wicket.apache.org
> > >> >> Subject: Re: url for images from database
> > >> >>
> > >> >> use a shared resource to output the images instead of 
> an Image 
> > >> >> component
> > >> >>
> > >> >> -igor
> > >> >>
> > >> >> On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F.
> > >> <mi...@seznam.cz> wrote:
> > >> >> > Hi folks,
> > >> >> >
> > >> >> > please direct me to right docu with following problem: I
> > >> >> have image as
> > >> >> > byte[] from database which I display on pages.
> > >> >> >
> > >> >> > Works fine, on image atribute src is somethink like this:
> > >> >> > <img
> > >> >> >
> > >> 
> src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/
> > >> >> > >
> > >> >> >
> > >> >> > For lightbox I need make this "ugly" src atribute
> > transform to
> > >> >> > something like src="/images/xxx.jpg" and mount it
> > >> >> on-the-fly but don't
> > >> >> > know how to do it.
> > >> >> >
> > >> >> > Is somewhere related example please?
> > >> >> >
> > >> >> > Thanks in advance,
> > >> >> >
> > >> >> > Miro
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >>
> > >> 
> > 
> ---------------------------------------------------------------------
> > >> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> >> > For additional commands, e-mail: 
> users-help@wicket.apache.org
> > >> >> >
> > >> >> >
> > >> >>
> > >> >>
> > >> 
> > 
> ---------------------------------------------------------------------
> > >> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> >> For additional commands, e-mail: users-help@wicket.apache.org
> > >> >>
> > >> >>
> > >> >
> > >> >
> > >> >
> > >> 
> > 
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> > For additional commands, e-mail: users-help@wicket.apache.org
> > >> >
> > >> >
> > >>
> > >> 
> > 
> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >>
> > >>
> > >
> > >
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: url for images from database

Posted by "Miroslav F." <mi...@seznam.cz>.
Thanks, was looking on classes :-)

Now I have code:

HTML:
<div style="	border: 1px solid #DCD4A7;
			float: left; position: relative;
			width: 207px; height: 340px;
			margin-top: 5px; margin-right: 20px; margin-bottom:
10px;">
	<a	href="#" wicket:id="anchor"
		rel="zbox"
		title="">
			<img	style="border: 3px solid #DCD4A7; padding:
1px 1px 1px 1px; width: 199px; height: 149px;" alt="" src=""
					wicket:id="image">
	</a>

Wicket:
DBImage image = new DBImage();
image.setImageData((byte[]) dataFromDB.get(dataOffset));

//not to cache images in browser
Double random = Math.random();

//put image into shared resources
Start.get().getSharedResources().add("image"+((String)
dataFromDB.get(textOffset)) + random.toString() + ".jpg", image);
ResourceReference imageResource = new ResourceReference("image"+((String)
dataFromDB.get(textOffset))+ random.toString()+".jpg");
String url=RequestCycle.get().urlFor(imageResource).toString();

//make "href" in "a" and "src" in "img" point to the same location for zbox
to make work
ExternalLink odkaz = new ExternalLink("anchor", url);
WebMarkupContainer imageSrcAttribute = new WebMarkupContainer("image");
imageSrcAttribute.add(new AttributeModifier("src", new Model<String>(url)));
odkaz.add(imageSrcAttribute);
odkaz.add(new SimpleAttributeModifier("title", (String) nazvy.get(i)));

this.add(odkaz); 


This works, not know if code is good from point of right way to do this in
wicket..

Miro



> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
> Sent: Thursday, 14. July 2011 18:11
> To: users@wicket.apache.org
> Subject: Re: url for images from database
> 
> look at the very bottom of that page....
> 
> -igor
> 
> On Thu, Jul 14, 2011 at 6:50 AM, Miroslav F. <mi...@seznam.cz> wrote:
> > Still be lost :-(
> >
> > This code I have in AppStart class:
> > mountSharedResource("/images/image1.jpg", new 
> > ResourceReference(Images.class, 
> "image1.jpg").getSharedResourceKey());
> >
> > Now after reading recomended example still not idea how to 
> replace new 
> > ResourceReference(... in above code snippet in a way in which I get 
> > from byte[] shared resource key.
> >
> > Please be kindfull, I'm in low level in java and greenhorn 
> in wicket 
> > :-D
> >
> > Miro
> >
> >
> >
> >> -----Original Message-----
> >> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> >> Sent: Tuesday, 12. July 2011 17:09
> >> To: users@wicket.apache.org
> >> Subject: Re: url for images from database
> >>
> >> https://cwiki.apache.org/WICKET/uploaddownload.html
> >>
> >> -igor
> >>
> >> On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. 
> <mi...@seznam.cz> wrote:
> >> > Is there example? How to get shared resource key from 
> byte[] (image 
> >> > from DB)? In my App class i do for several shared resources:
> >> > mountSharedResource("/styles/style.css", new 
> >> > ResourceReference(Styles.class,
> >> "style.css").getSharedResourceKey());
> >> >
> >> > Is is possible in this code getsharedResource() for byte[]
> >> (image from
> >> > DB) in some way?
> >> >
> >> >
> >> >> -----Original Message-----
> >> >> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> >> >> Sent: Sunday, 10. July 2011 18:16
> >> >> To: users@wicket.apache.org
> >> >> Subject: Re: url for images from database
> >> >>
> >> >> use a shared resource to output the images instead of an Image 
> >> >> component
> >> >>
> >> >> -igor
> >> >>
> >> >> On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F.
> >> <mi...@seznam.cz> wrote:
> >> >> > Hi folks,
> >> >> >
> >> >> > please direct me to right docu with following problem: I
> >> >> have image as
> >> >> > byte[] from database which I display on pages.
> >> >> >
> >> >> > Works fine, on image atribute src is somethink like this:
> >> >> > <img
> >> >> >
> >> src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/
> >> >> > >
> >> >> >
> >> >> > For lightbox I need make this "ugly" src atribute 
> transform to 
> >> >> > something like src="/images/xxx.jpg" and mount it
> >> >> on-the-fly but don't
> >> >> > know how to do it.
> >> >> >
> >> >> > Is somewhere related example please?
> >> >> >
> >> >> > Thanks in advance,
> >> >> >
> >> >> > Miro
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> 
> ---------------------------------------------------------------------
> >> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> >> > For additional commands, e-mail: users-help@wicket.apache.org
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> 
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> >> For additional commands, e-mail: users-help@wicket.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> 
> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> > For additional commands, e-mail: users-help@wicket.apache.org
> >> >
> >> >
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: url for images from database

Posted by Igor Vaynberg <ig...@gmail.com>.
look at the very bottom of that page....

-igor

On Thu, Jul 14, 2011 at 6:50 AM, Miroslav F. <mi...@seznam.cz> wrote:
> Still be lost :-(
>
> This code I have in AppStart class:
> mountSharedResource("/images/image1.jpg", new
> ResourceReference(Images.class, "image1.jpg").getSharedResourceKey());
>
> Now after reading recomended example still not idea how to replace new
> ResourceReference(... in above code snippet
> in a way in which I get from byte[] shared resource key.
>
> Please be kindfull, I'm in low level in java and greenhorn in wicket :-D
>
> Miro
>
>
>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Sent: Tuesday, 12. July 2011 17:09
>> To: users@wicket.apache.org
>> Subject: Re: url for images from database
>>
>> https://cwiki.apache.org/WICKET/uploaddownload.html
>>
>> -igor
>>
>> On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. <mi...@seznam.cz> wrote:
>> > Is there example? How to get shared resource key from byte[] (image
>> > from DB)? In my App class i do for several shared resources:
>> > mountSharedResource("/styles/style.css", new
>> > ResourceReference(Styles.class,
>> "style.css").getSharedResourceKey());
>> >
>> > Is is possible in this code getsharedResource() for byte[]
>> (image from
>> > DB) in some way?
>> >
>> >
>> >> -----Original Message-----
>> >> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> >> Sent: Sunday, 10. July 2011 18:16
>> >> To: users@wicket.apache.org
>> >> Subject: Re: url for images from database
>> >>
>> >> use a shared resource to output the images instead of an Image
>> >> component
>> >>
>> >> -igor
>> >>
>> >> On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F.
>> <mi...@seznam.cz> wrote:
>> >> > Hi folks,
>> >> >
>> >> > please direct me to right docu with following problem: I
>> >> have image as
>> >> > byte[] from database which I display on pages.
>> >> >
>> >> > Works fine, on image atribute src is somethink like this:
>> >> > <img
>> >> >
>> src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/
>> >> > >
>> >> >
>> >> > For lightbox I need make this "ugly" src atribute transform to
>> >> > something like src="/images/xxx.jpg" and mount it
>> >> on-the-fly but don't
>> >> > know how to do it.
>> >> >
>> >> > Is somewhere related example please?
>> >> >
>> >> > Thanks in advance,
>> >> >
>> >> > Miro
>> >> >
>> >> >
>> >> >
>> >>
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> > For additional commands, e-mail: users-help@wicket.apache.org
>> >> >
>> >> >
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: url for images from database

Posted by "Miroslav F." <mi...@seznam.cz>.
Still be lost :-( 

This code I have in AppStart class:
mountSharedResource("/images/image1.jpg", new
ResourceReference(Images.class, "image1.jpg").getSharedResourceKey());

Now after reading recomended example still not idea how to replace new
ResourceReference(... in above code snippet
in a way in which I get from byte[] shared resource key.

Please be kindfull, I'm in low level in java and greenhorn in wicket :-D

Miro



> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
> Sent: Tuesday, 12. July 2011 17:09
> To: users@wicket.apache.org
> Subject: Re: url for images from database
> 
> https://cwiki.apache.org/WICKET/uploaddownload.html
> 
> -igor
> 
> On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. <mi...@seznam.cz> wrote:
> > Is there example? How to get shared resource key from byte[] (image 
> > from DB)? In my App class i do for several shared resources:
> > mountSharedResource("/styles/style.css", new 
> > ResourceReference(Styles.class, 
> "style.css").getSharedResourceKey());
> >
> > Is is possible in this code getsharedResource() for byte[] 
> (image from 
> > DB) in some way?
> >
> >
> >> -----Original Message-----
> >> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> >> Sent: Sunday, 10. July 2011 18:16
> >> To: users@wicket.apache.org
> >> Subject: Re: url for images from database
> >>
> >> use a shared resource to output the images instead of an Image 
> >> component
> >>
> >> -igor
> >>
> >> On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. 
> <mi...@seznam.cz> wrote:
> >> > Hi folks,
> >> >
> >> > please direct me to right docu with following problem: I
> >> have image as
> >> > byte[] from database which I display on pages.
> >> >
> >> > Works fine, on image atribute src is somethink like this:
> >> > <img
> >> > 
> src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/
> >> > >
> >> >
> >> > For lightbox I need make this "ugly" src atribute transform to 
> >> > something like src="/images/xxx.jpg" and mount it
> >> on-the-fly but don't
> >> > know how to do it.
> >> >
> >> > Is somewhere related example please?
> >> >
> >> > Thanks in advance,
> >> >
> >> > Miro
> >> >
> >> >
> >> >
> >> 
> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> > For additional commands, e-mail: users-help@wicket.apache.org
> >> >
> >> >
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: url for images from database

Posted by Igor Vaynberg <ig...@gmail.com>.
https://cwiki.apache.org/WICKET/uploaddownload.html

-igor

On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. <mi...@seznam.cz> wrote:
> Is there example? How to get shared resource key from byte[] (image from
> DB)? In my App class i do for several
> shared resources:
> mountSharedResource("/styles/style.css", new ResourceReference(Styles.class,
> "style.css").getSharedResourceKey());
>
> Is is possible in this code getsharedResource() for byte[] (image from DB)
> in some way?
>
>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Sent: Sunday, 10. July 2011 18:16
>> To: users@wicket.apache.org
>> Subject: Re: url for images from database
>>
>> use a shared resource to output the images instead of an
>> Image component
>>
>> -igor
>>
>> On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. <mi...@seznam.cz> wrote:
>> > Hi folks,
>> >
>> > please direct me to right docu with following problem: I
>> have image as
>> > byte[] from database which I display on pages.
>> >
>> > Works fine, on image atribute src is somethink like this:
>> > <img
>> > src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/>
>> >
>> > For lightbox I need make this "ugly" src atribute transform to
>> > something like src="/images/xxx.jpg" and mount it
>> on-the-fly but don't
>> > know how to do it.
>> >
>> > Is somewhere related example please?
>> >
>> > Thanks in advance,
>> >
>> > Miro
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: url for images from database

Posted by "Miroslav F." <mi...@seznam.cz>.
Is there example? How to get shared resource key from byte[] (image from
DB)? In my App class i do for several
shared resources:
mountSharedResource("/styles/style.css", new ResourceReference(Styles.class,
"style.css").getSharedResourceKey());

Is is possible in this code getsharedResource() for byte[] (image from DB)
in some way?


> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
> Sent: Sunday, 10. July 2011 18:16
> To: users@wicket.apache.org
> Subject: Re: url for images from database
> 
> use a shared resource to output the images instead of an 
> Image component
> 
> -igor
> 
> On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. <mi...@seznam.cz> wrote:
> > Hi folks,
> >
> > please direct me to right docu with following problem: I 
> have image as 
> > byte[] from database which I display on pages.
> >
> > Works fine, on image atribute src is somethink like this:
> > <img 
> > src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/>
> >
> > For lightbox I need make this "ugly" src atribute transform to 
> > something like src="/images/xxx.jpg" and mount it 
> on-the-fly but don't 
> > know how to do it.
> >
> > Is somewhere related example please?
> >
> > Thanks in advance,
> >
> > Miro
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: url for images from database

Posted by Igor Vaynberg <ig...@gmail.com>.
use a shared resource to output the images instead of an Image component

-igor

On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. <mi...@seznam.cz> wrote:
> Hi folks,
>
> please direct me to right docu with following problem: I have image as
> byte[]
> from database which I display on pages.
>
> Works fine, on image atribute src is somethink like this:
> <img src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/>
>
> For lightbox I need make this "ugly" src atribute transform to something
> like src="/images/xxx.jpg" and mount it on-the-fly but don't know how to do
> it.
>
> Is somewhere related example please?
>
> Thanks in advance,
>
> Miro
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org