Larry,

you could register a Servlet under the URL-pattern /downloads/WEB-INF/* that always
returns HttpServletResonse.SC_FORBIDDEN. Like this:

import javax.servlet.*;
import javax.servlet.http.*;
public DownloadForbidden extends GenericServlet {
    public void service(ServletRequest req, ServletResponse res) {
        ((HttpServletRequest)res).sendError(HttpServletResonse.SC_FORBIDDEN, "your
message");
    }
}

web.xml excerpt:
...
<servlet>
 <servlet-name>
  DownloadForbidden
 </servlet-name>
 <servlet-class>
  DownloadForbidden
 </servlet-class>
</servlet>
<servlet-mapping>
 <servlet-name>
  DownloadForbidden
 </servlet-name>
 <url-pattern>
  /downloads/WEB-INF/*
 </url-pattern>
</servlet-mapping>
...

cheers,

-hendrik
- - - - - - - - - - - - - - - - - - - - - - - - - - -
  tagtraum industries      http://www.tagtraum.com/
  jo!                 small&smart 2.2 servletengine
  Java Server & Servlets   The web-application book
  The WebApp Framework        http://www.webapp.de/



Larry Hoffman wrote:

> I have the following set up... I created a downloads directory.  Under the
> downloads directory I created the WEB-INF directory.  At this same level I
> created a files directory.  Under the WEB-INF directory I created the
> classes dir. i.e.:
>
> +downloads
>        +-WEB-INF
>        |     +-classes
>        |
>        +-files
>
> I want to be able to hide the entire downloads directory from view... Much
> the same way the WEB-INF directory is hidden from view... Any
> suggestions... -Larry
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> 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".
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