Hi all,

I have an embedded jetty that is used to serve static resources only; how 
can
I tell Jetty to stop directory listing request from clients?  I have the 
following piece
of code, but it doesn't seem to be doing the job.  What am I missing? Here 
is the
code snippet.  I am running Jetty 7

 
            context = new ContextHandler();
            context.setContextPath("/");
            context.setResourceBase("../xxx/jetty/docroot");
            rh = new ResourceHandler();
            rh.setDirectoriesListed( false );
            rh.setAliases( false );
            context.setHandler(rh);
            handlers[0] = context;
 
            context = new ContextHandler();
            context.setContextPath("/lib");
            context.setResourceBase(config.getLibRoot());
            rh = new ResourceHandler();
            rh.setDirectoriesListed( false );
            rh.setAliases( false );
            context.setHandler(rh);
            handlers[1] = context;
 
            hc.setHandlers(handlers);
            server.setHandler(hc); 

When I try, say, http://localhost:8080/lib/res I am getting 404 instead
of 403. I was expecting to get 403 instead of 404. Any suggestions would 
be appreciated.

Thanks,

Ike
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to