Imagine this situation: users have accounts on photo album where they upload images. System from uploaded images create thumbnails. Users can browse their photo - there is combo "show 25", "show 50"... "show all" images. On page I render thumbnails on a page which are shadowbox clickable images. All images ("show all") I do in way described below. Works fine but in extreme situation there is user with more than 3.000 images in one photoalbum.
Or -how to do it better way? Thanks, Laco > -----Original Message----- > From: Bas Gooren [mailto:b...@iswd.nl] > Sent: Thursday, March 10, 2011 11:32 PM > To: users@wicket.apache.org > Subject: Re: mountSharedResource() on huge amount of images > > The general idea is to mount a single handler, which takes > the filename from the url. > There is no reason to mount all images by such a handler one-by-one. > > Bas > > Op 10-3-2011 23:01, Ladislav DANKO schreef: > > Hi all, > > > > what is the recommended way to mount huge amount of an images > > (thousands) in app? Does mountSharedResource() has any bottleneck? > > Simplified code look > > like: > > > > Folder folder = ((Start) Application.get()).getUploadFolder(); > > File[] files = folder.getFiles(); > > List<File> lList = Arrays.asList(files); > Collections.sort(lList); int > > i = 0; Iterator<File> iterator = lList.iterator(); > > while(iterator.hasNext()) > > { > > iterator.next(); > > String fileName = lList.get(i).getName(); > > mountSharedResource("/images/" + fileName, new > > ResourceReference(Images.class, fileName).getSharedResourceKey()); > > i++; > > } > > > > But what if in folder is for example 100.000 photos? > > > > Thanks for pointing, > > > > -- > > Ladislav DANKO > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org