Hi.
I am facing the same problem: user upload images and I want to access
from wicket.
Of course, user resources are not going to stay under the webapp context.
I would prefer also to put this images wherever I want in the file
system, not under the container folder as well.
I have taken some
Question, as I am dealing with a similar issue, except I save my file
to my glassfish directory (ie: glassfish/domains/domain1/uploads/
Videos/...). I can't seem to find the url though I have tried many
different types of urls...
For the record
((WebApplication
)WebApplication
Matthew, this seems like a glassfish question... if you can mount local
system dirs in glassfish as web dirs, for example:
alternatedocroot_1 from=/uploads/*
dir=/Users/insane/path/under/netbeans/glassfish/domain1/uploads/Videos
would you access that content using http://www.mysite.com/uploads/*
Correct, Glassfish would allow this; however, if I can do it
programmatically with ease I would rather do this (as installations
may change and I would rather not have the static uri). I assumed
Wicket had access to all files in the context root (or what I assume
is one, which maybe
Well after my question I started researching and changed my upload folder
to:
String path = WebApplication.get().getServletContext().getRealPath();
Folder uploadFolder = new Folder(path+/uploads);
I can now reference the files via the url (.../uploads/..), so much simpler
this way... I suppose
Good call -- going the intercept-and-stream route is great when you cannot
read from a web-addressable folder, but if you can do that, and can avoid
all that server-side processing by using a direct URL and just let the app
server do it's thing, then +1 on that.
Sounds like you got it going that
Thanks Ernesto, Jonas, Riyad, Don and Thomas.
I implemented all of your solutions.
I ended up with this one :
1) In the application init method I call this method, which add a directory to
the WebApplicationPath
private void initPath() {
WebApplicationPath resourceFinder =
Ernesto,
Sorry about that -- I didn't mean to imply your impl was back, that was more
directed at Francois along the lines of that's a lot of overhead, are you
sure you need to do that? -- but now that I understand what his use-case is
(saw his last reply about /usr/ext/img/IMAGES HERE) I get it.
Hi Riyad,
I didn't get offended by your message... which otherwise raised a very valid
issue.
Cheers,
Ernesto
On Thu, Jan 28, 2010 at 5:26 PM, Riyad Kalla rka...@gmail.com wrote:
Ernesto,
Sorry about that -- I didn't mean to imply your impl was back, that was
more
directed at Francois
Hi Wicketers,
I have a directory, /xxx/images with uploaded images, which is not under the
application context root directory.
How can I serve them as static images ?
I tried the StaticImage class I found in the forum
(http://old.nabble.com/Plain-IMG-src-urls-td21547371.html#a21547543 )
but it
Just a couple of ideas...
-Use a servlet to serve them? You don´t need Wicket for this... and combine
this with simpleimage?
-With Wicket mount a dynamic web-resource and combine this with simpleimage?
Ernesto
2010/1/27 François Meillet fm...@meillet.com
Hi Wicketers,
I have a directory,
I used this suggestion to serve images out of a database, and it
worked very well:
http://dotev.blogspot.com/2009/11/serving-images-and-other-resources-with.html
On Jan 27, 2010, at 5:56 AM, Ernesto Reinaldo Barreiro wrote:
Just a couple of ideas...
-Use a servlet to serve them? You don´t
Have you tried the following:
WebComponent image = new WebComponent(someWicketId);
image.add(new SimpleAttributeModifier(src, http://.jpg;));
add(image);
with markup
img wicket:id=someWicketId /
that should work just fine...
if you cannot hardcode the image url, you can use the following
this trick with the alias... I has done it mounting a dynamic WebResource
and streaming back the contents myself. Like in here
http://code.google.com/p/antilia/source/browse/trunk/com.antilia.demo.manager/src/com/antilia/demo/manager/img/MyImageMountedFactory.java
Best,
Ernesto
On Wed,
nice trick with the alias... was what I intended to say.
On Wed, Jan 27, 2010 at 4:00 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
this trick with the alias... I has done it mounting a dynamic WebResource
and streaming back the contents myself. Like in here
On 01/27/10 15:57, Jonas wrote:
Have you tried the following:
WebComponent image = new WebComponent(someWicketId);
image.add(new SimpleAttributeModifier(src, http://.jpg;));
add(image);
with markup
img wicket:id=someWicketId /
that should work just fine...
if you cannot hardcode the
Thank for yours posts.
I try the solutions, but I can't figure out how to serve images as static
images.
F.
Le 27 janv. 2010 à 16:10, Thomas Kappler a écrit :
On 01/27/10 15:57, Jonas wrote:
Have you tried the following:
WebComponent image = new WebComponent(someWicketId);
image.add(new
Hi Francois,
Following example works.
1-Create this class anywhere you want need.
package com.antilia.demo.manager.img;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import
This seems like adding a large amount of overhead to an image-heavy site
(e.g. image blog or something), I thought I read in Wicket in Action that
WicketFilter ignored HTTP requests for non-wicket resources now and passed
them through to the underlying server to handle avoiding the need to remap
Sure it is overhead but he wanted to serve images from a folder not
under application
context root directory... Then, you have to serve them somehow? The options
I see are
1-A dedicated servlet?
2-With Wicket... and thats what the code shows... and for sure it can be
done in a simpler way...
A
20 matches
Mail list logo