Lemonte,
If you put the directory under the WEB-INF directory of your web
application, the resources (files) in that directory will only be
accessible to servlets and JSPs.  You could then have a servlet serve up
the desired files by specifying the name of the file as a query
string.  The reason a servlet would be used instead of a JSP is that JSPs
are meant to only return textual data.

"The Servlet specification requires that servlets not call both
ServletResponse.getOutputStream() and ServletResponse.getWriter().
Because JSP pages already call getWriter(), they must not also
call getOutputStream(). Some versions of Tomcat delay the calling
of getWriter(), so that the tip might work for those versions.
However the operations demonstrated in the tip should be
considered illegal. JSP pages are only meant to deliver textual
output."  JDC Tech Tips for August 21, 2001

-Richard

01:50 PM 8/30/01 -0400, you wrote:
>Is there a way to stop a directory or binary file from being opened unless
>it is launched from a JSP. (I'm using orion - OC4J)
>
>For example:  I have an image at:
>http://hostname/images/1/2/3/4/filename.tif
>
>If the JSP launches it - show the image.
>
>If a user tries to type in the path - they get an error.
>
>
>Any ideas . . .
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to