Re: Image from resource outside tomcat container

2008-05-27 Thread Igor Vaynberg
your hibernate second level cache should take care of this double
loading problem...

-igor

On Tue, May 27, 2008 at 1:24 AM, Mathias P.W Nilsson
[EMAIL PROTECTED] wrote:

 Sorry! I forgot to respond to Igor and Michael Sparer

 Igor.
 I do not need the id. I just used for better url. And then I got the path
 from spring in the servlet and served the files from there. All files is in
 a table in my database called FileResources. If a entity has a file it has a
 relation to this table. Since I must know what image to load, I used id but
 have now switched to filepath wich is very ugly and long as you saw. There
 is no logick in the naming of a file. A jpg file mapped to an item can have
 a name like 2394123840238eriuqweirew.jpg

 Michael.
 Yes. I have googled and created Filter, servlet to get the think you
 suggested to work but I'm not able to. I got the file by doing getRequestURI
 in the filter class but was not able to edit the uri. Is this the way of
 doing this?






 Mathias P.W Nilsson wrote:

 When trying this it does not work. I try to mount /Files/* for the servlet
 and it doens not respond.

 What do you mean by mapping id? Should I have all image paths in memory.
 Their will be approximately 100.000 images.


 --
 View this message in context: 
 http://www.nabble.com/Image-from-resource-outside-tomcat-container-tp17276444p17485422.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]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Image from resource outside tomcat container

2008-05-27 Thread James Carman
If it's during the same request, the first-level cache will ensure
that you get the same identical instance when it's requested.

On Tue, May 27, 2008 at 1:16 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 your hibernate second level cache should take care of this double
 loading problem...

 -igor

 On Tue, May 27, 2008 at 1:24 AM, Mathias P.W Nilsson
 [EMAIL PROTECTED] wrote:

 Sorry! I forgot to respond to Igor and Michael Sparer

 Igor.
 I do not need the id. I just used for better url. And then I got the path
 from spring in the servlet and served the files from there. All files is in
 a table in my database called FileResources. If a entity has a file it has a
 relation to this table. Since I must know what image to load, I used id but
 have now switched to filepath wich is very ugly and long as you saw. There
 is no logick in the naming of a file. A jpg file mapped to an item can have
 a name like 2394123840238eriuqweirew.jpg

 Michael.
 Yes. I have googled and created Filter, servlet to get the think you
 suggested to work but I'm not able to. I got the file by doing getRequestURI
 in the filter class but was not able to edit the uri. Is this the way of
 doing this?






 Mathias P.W Nilsson wrote:

 When trying this it does not work. I try to mount /Files/* for the servlet
 and it doens not respond.

 What do you mean by mapping id? Should I have all image paths in memory.
 Their will be approximately 100.000 images.


 --
 View this message in context: 
 http://www.nabble.com/Image-from-resource-outside-tomcat-container-tp17276444p17485422.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]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Image from resource outside tomcat container

2008-05-16 Thread Mathias P.W Nilsson

Hi!

I have placed all my images in a folder outside my web application container
to preserve the images when I deploy.

My problem now is that to get an image I go thru my FileResourceServlet and
writes the image.
In every request to my FileResourceServlet I make a request to the database
to get the image. This is slow when all my images go thru this servlet. can
wicket handle resources outside the container?
-- 
View this message in context: 
http://www.nabble.com/Image-from-resource-outside-tomcat-container-tp17276444p17276444.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]



Re: Image from resource outside tomcat container

2008-05-16 Thread Michael Sparer

why do you make a request to the database?

in our app, we use a servletfilter to get the resources from harddisk ...
without hitting the wicket filter



Mathias P.W Nilsson wrote:
 
 Hi!
 
 I have placed all my images in a folder outside my web application
 container to preserve the images when I deploy.
 
 My problem now is that to get an image I go thru my FileResourceServlet
 and writes the image.
 In every request to my FileResourceServlet I make a request to the
 database to get the image. This is slow when all my images go thru this
 servlet. can wicket handle resources outside the container?
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Image-from-resource-outside-tomcat-container-tp17276444p17276617.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]



Re: Image from resource outside tomcat container

2008-05-16 Thread Mathias P.W Nilsson

Really for now I do this for url

FileResourceServlet?fileResourceId=101

Else I need to do this.
FileResourceServlet?path=very...veryvery.long...pathforthefile

How do you know wich file to fetch?
-- 
View this message in context: 
http://www.nabble.com/Image-from-resource-outside-tomcat-container-tp17276444p17276901.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]



Re: Image from resource outside tomcat container

2008-05-16 Thread Igor Vaynberg
you need to set proper caching headers and have your servlet implement
an efficient HEAD support.

-igor


On Fri, May 16, 2008 at 7:43 AM, Mathias P.W Nilsson
[EMAIL PROTECTED] wrote:

 Hi!

 I have placed all my images in a folder outside my web application container
 to preserve the images when I deploy.

 My problem now is that to get an image I go thru my FileResourceServlet and
 writes the image.
 In every request to my FileResourceServlet I make a request to the database
 to get the image. This is slow when all my images go thru this servlet. can
 wicket handle resources outside the container?
 --
 View this message in context: 
 http://www.nabble.com/Image-from-resource-outside-tomcat-container-tp17276444p17276444.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]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]