I don't know why this would be any slower than tomcat itself? Tomcat serves images by loading them as a stream from the default servlet and returns them to the browser. It all depends on how you implement this. It very well could be faster than Tomcat itself since a servlet dedicated to serving images might be even faster than a Tomcat's default servlet which must take care of serving all kinds of files and, therefore, probably has more overhead.
Jake
At 09:52 AM 6/9/2003 -0400, you wrote:
Could you just put all of the images under WEB-INF, and use a special servlet to get them?
The source attribute of the IMG tag would be something like /servlet/imgGetter?image=someUniqueKey.
The servlet would just retrieve the image from the WEB-INF directory, and spool it out as a stream.
I'm not sure on the performance, though. High-traffic might be a problem.
John
On Mon, 9 Jun 2003 09:43:48 -0400, Shapira, Yoav <[EMAIL PROTECTED]> wrote:
Howdy, That one's tricky (and strange). When you have a servlet or JSP, the output the user sees is HTML. In HTML, you have <img> tags. The browser will request those images normally in HTTP requests. So from the server's perspective, the request is the same whether the user types in the image URL or you embed it in one of your pages.
Would something like using a mangled images directory name ($KF_%# or something) be sufficient? A name that's hard for users to guess and use directly?
Yoav Shapira Millennium ChemInformatics
web.-----Original Message----- From: Syed Nayyer Kamran [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2003 9:33 PM To: [EMAIL PROTECTED] Subject: Urgent : Can we restrict access to a directory in tomcat
hi there,
I want to restrict the user to access the images directly through theThey should be able to access these images through web pages developedasjsp/servlet but should not be able to access these images displayed onpageby copying the image url to the address bar. Is tomcat directly support this functionality. or any other solution.
Thanks in advance for any solution of the problem.
Nayyer Kamran
This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]