Search in sources :

Example 1 with PrefixHandlerMapping

use of de.codecentric.boot.admin.web.PrefixHandlerMapping in project spring-boot-admin by codecentric.

the class AdminServerWebConfiguration method prefixHandlerMapping.

@Bean
public PrefixHandlerMapping prefixHandlerMapping() {
    Map<String, Object> beans = applicationContext.getBeansWithAnnotation(AdminController.class);
    PrefixHandlerMapping prefixHandlerMapping = new PrefixHandlerMapping(beans.values().toArray(new Object[beans.size()]));
    prefixHandlerMapping.setPrefix(adminServerProperties.getContextPath());
    return prefixHandlerMapping;
}
Also used : PrefixHandlerMapping(de.codecentric.boot.admin.web.PrefixHandlerMapping) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

PrefixHandlerMapping (de.codecentric.boot.admin.web.PrefixHandlerMapping)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1