Search in sources :

Example 1 with RootServlet

use of org.apache.qpid.server.management.plugin.servlet.RootServlet in project qpid-broker-j by apache.

the class HttpManagement method addFiltersAndServletsForUserInterfaces.

private void addFiltersAndServletsForUserInterfaces(final ServletContextHandler root) {
    root.addFilter(new FilterHolder(new AuthenticationCheckFilter()), "/apidocs/*", EnumSet.of(DispatcherType.REQUEST));
    root.addFilter(new FilterHolder(new InteractiveAuthenticationFilter()), DEFAULT_LOGIN_URL, EnumSet.of(DispatcherType.REQUEST));
    root.addFilter(new FilterHolder(new InteractiveAuthenticationFilter()), "/", EnumSet.of(DispatcherType.REQUEST));
    FilterHolder redirectFilter = new FilterHolder(new RedirectFilter());
    redirectFilter.setInitParameter(RedirectFilter.INIT_PARAM_REDIRECT_URI, DEFAULT_LOGIN_URL);
    root.addFilter(redirectFilter, "/login.html", EnumSet.of(DispatcherType.REQUEST));
    if (_serveUncompressedDojo) {
        root.addFilter(RewriteRequestForUncompressedJavascript.class, "/dojo/dojo/*", EnumSet.of(DispatcherType.REQUEST));
        root.addFilter(RewriteRequestForUncompressedJavascript.class, "/dojo/dojox/*", EnumSet.of(DispatcherType.REQUEST));
    }
    addApiDocsServlets(root);
    root.addServlet(new ServletHolder(new SaslServlet()), "/service/sasl");
    root.addServlet(new ServletHolder(new RootServlet("/", "/apidocs/", "index.html")), "/");
    root.addServlet(new ServletHolder(new LogoutServlet()), "/logout");
    root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDojoPath(), true)), "/dojo/dojo/*");
    root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDijitPath(), true)), "/dojo/dijit/*");
    root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDojoxPath(), true)), "/dojo/dojox/*");
    root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDgridPath(), true)), "/dojo/dgrid/*");
    root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDstorePath(), true)), "/dojo/dstore/*");
    for (String pattern : STATIC_FILE_TYPES) {
        root.addServlet(new ServletHolder(new FileServlet()), pattern);
    }
}
Also used : FilterHolder(org.eclipse.jetty.servlet.FilterHolder) RedirectFilter(org.apache.qpid.server.management.plugin.filter.RedirectFilter) FileServlet(org.apache.qpid.server.management.plugin.servlet.FileServlet) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) AuthenticationCheckFilter(org.apache.qpid.server.management.plugin.filter.AuthenticationCheckFilter) RootServlet(org.apache.qpid.server.management.plugin.servlet.RootServlet) SaslServlet(org.apache.qpid.server.management.plugin.servlet.rest.SaslServlet) InteractiveAuthenticationFilter(org.apache.qpid.server.management.plugin.filter.InteractiveAuthenticationFilter) LogoutServlet(org.apache.qpid.server.management.plugin.servlet.rest.LogoutServlet)

Aggregations

AuthenticationCheckFilter (org.apache.qpid.server.management.plugin.filter.AuthenticationCheckFilter)1 InteractiveAuthenticationFilter (org.apache.qpid.server.management.plugin.filter.InteractiveAuthenticationFilter)1 RedirectFilter (org.apache.qpid.server.management.plugin.filter.RedirectFilter)1 FileServlet (org.apache.qpid.server.management.plugin.servlet.FileServlet)1 RootServlet (org.apache.qpid.server.management.plugin.servlet.RootServlet)1 LogoutServlet (org.apache.qpid.server.management.plugin.servlet.rest.LogoutServlet)1 SaslServlet (org.apache.qpid.server.management.plugin.servlet.rest.SaslServlet)1 FilterHolder (org.eclipse.jetty.servlet.FilterHolder)1 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)1