Hi,
I'm not sure, if I understand you correctly, but why do you not want to
store the Image in the database?
BTW: In HttpServlet, there are methods to get the directory of a
webapplication where you could store files.
Ciao,
Ingo
andrew.kitchen@gmail.com - 17 Jul 2006 13:56 GMT
Hi Ingo,
I recon the images are best saved to disk than the database, especially
as I am using a remote shared server. If I were running this on my own
machine I might think differently. It is the backup issue and file
copying that move me towards having a file system solution, as I could
have several thousand images in a year's time.
I'll try and clarify the problem here:
I have a web application context deployed in a WAR file called
context1. This is the main application. I have configured a second
context called context2 which has a docBase outside of context1'.
Within the context1 application I have a Struts enabled JSP with a form
for submitting an image file. This form's corresponding action class,
when complete, will get the file and write it to a directory within
context2 of my chosing. I might have to create a new directory, but the
long and short of it is that it will be written to this context.
In context1's web application there will be another JSP that will
display the image, but via a servlet so that I can overlay watermarking
on the image and create a dynamic thumbnail.
I hope that makes things more clear?
Thanks in advance for your help.
Andrew
> Hi,
>
[quoted text clipped - 6 lines]
> Ciao,
> Ingo
Ingo R. Homann - 17 Jul 2006 14:10 GMT
Hi,
Well, what about a system-parameter in which you specify the directory,
in which the images should be stored?
Ciao,
Ingo
andrew.kitchen@gmail.com - 17 Jul 2006 14:34 GMT
Ingo,
So you recon perhaps just setting a simple system parameter is the best
idea? I was trying to make it as neat as possible, but I suppose my way
is overcomplicating things.
I'll try and just write to a repository directory and see whether that
works.
thanks,
andrew
> Hi,
>
[quoted text clipped - 3 lines]
> Ciao,
> Ingo
andrew.kitchen@gmail.com - 18 Jul 2006 08:00 GMT
Ingo,
> BTW: In HttpServlet, there are methods to get the directory of a
> webapplication where you could store files.
Which methods are these and can you give me an example?
Thanks,
Andrew
Ingo R. Homann - 18 Jul 2006 08:17 GMT
Hi andrew,
>>BTW: In HttpServlet, there are methods to get the directory of a
>>webapplication where you could store files.
>
> Which methods are these and can you give me an example?
RTFM:
out.println(getServletContext().getRealPath(".") + "<br>");
Hth,
Ingo
andrew.kitchen@gmail.com - 18 Jul 2006 14:45 GMT
Ah right - I had used this one already but had used "/" instread of "."
Thanks for that - I had already RTFM - I wasn't being a clown!
Andrew
> Hi andrew,
>
[quoted text clipped - 9 lines]
> Hth,
> Ingo