[jetty-user] Static content with authentication?

Arjun Panday <[email protected]> Wed, 22 Jun 2011 10:25:48 +0200
Newsgroups gmane.comp.java.jetty.support
Organization Alcatel-Lucent
Message-ID <[email protected]>
Hi all,

I'm looking for way to configure the DefaultServlet used to serve static 
content on disk, so that it uses a form based authentication.

Here's what I have:
- an (embedded) jetty server, with 2 connectors: 1 private IP using 
regular HTTP, 1 public IP using HTTPS
- some webapps are served on the public IP and require authentication
- some webapps are served on the private IP and require no authentication

So far so good, but my server is also used to serve static disk content 
(not packaged in webapps) and i need the same :
- some static content is needed on the private IP without authent'
- some static content is needed on the public IP with authent'

I am able to serve the static content on the private IP by specifying 
the connector name as explained here 
http://docs.codehaus.org/display/JETTY/Static+Content and here 
http://wiki.eclipse.org/Jetty/Howto/WebappPerConnector

But I can't find a way to specify the security-constraint and 
login-config for the public static content.

Alternatively I could map the DefaultServlet from a webapp (so as to 
have a web.xml) but then how can I serve static content? Setting the 
resourceBase init-param to an absolute path doesn't seem to work (not to 
mention the use of an environment variable for the root path).

I hope my question is clear and someone can help,
Thanks,
Arjun

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email