i don't know if we're talking about the same thing :-).
what i'm talking about is to serve static files that reside outside the
webapp context. e.g. after a fileupload by a user using a webform the file
gets saved to somewhere on the harddisk where it's not gonna be replaced on
redeploy.
what i do is to save the relative path to the file to my entity (e.g.
getImagePath() returns /img/foobar.png) and that's what you see in the
markup. then i set a filter to /img/*.
the filter extends jetty's DefaultServlet and implements filter. there I
override the method
@Override
public Resource getResource(final String pathInContext) {
return new FileResource(_fileRoot + pathInContext);
}
where _fileRoot is the place where the files are (e.g.
/opt/mywebapp/images).
anyway, if you have an apache in front of your servlet container, i'd rather
let apache serve the static files ...
and now? are we talking about the same thing? ;-)
regards,
Michael
Mathias P.W Nilsson wrote:
>
> Really.... for now I do this for url
>
> FileResourceServlet?fileResourceId=101
>
> Else I need to do this.
> FileResourceServlet?path=very...very....very.....long...path....for....the....file
>
> How do you know wich file to fetch?
>
-----
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context:
http://www.nabble.com/Image-from-resource-outside-tomcat-container-tp17276444p17278962.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]