Example usage for org.springframework.web.context.support ServletContextAttributeExporter ServletContextAttributeExporter

List of usage examples for org.springframework.web.context.support ServletContextAttributeExporter ServletContextAttributeExporter

Introduction

In this page you can find the example usage for org.springframework.web.context.support ServletContextAttributeExporter ServletContextAttributeExporter.

Prototype

ServletContextAttributeExporter

Source Link

Usage

From source file:org.ezand.telldus.rest.config.SwaggerConfig.java

@Autowired
@Bean/*from   w w w .j  a  v a 2  s. c o  m*/
public ServletContextAttributeExporter contextAttributes(final SwaggerSettings settings) {
    final Map<String, Object> attributes = newHashMap();
    attributes.put("swagger",
            new Swagger().info(new Info().title(settings.getTitle())
                    .contact(new Contact().email(settings.getContact())).license(new License()
                            .name(settings.getLicense().getTitle()).url(settings.getLicense().getUrl()))
                    .description(settings.getDescription())));

    final ServletContextAttributeExporter exporter = new ServletContextAttributeExporter();
    exporter.setAttributes(attributes);
    return exporter;
}

From source file:org.haiku.haikudepotserver.config.AppConfig.java

@Bean
public ServletContextAttributeExporter servletContextAttributeExporter(MetricRegistry metricRegistry,
        HealthCheckRegistry healthCheckRegistry) {
    ServletContextAttributeExporter exporter = new ServletContextAttributeExporter();
    exporter.setAttributes(ImmutableMap.of("com.codahale.metrics.servlets.MetricsServlet.registry",
            metricRegistry, "com.codahale.metrics.servlets.HealthCheckServlet.registry", healthCheckRegistry));
    return exporter;
}