All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.k2.core.RootDispatcherServletConfiguration Maven / Gradle / Ivy

The newest version!
package com.k2.core;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation
    .ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation
    .WebMvcConfigurationSupport;

/** A spring configuration class to use in the root dispatcher servlet.
 *
 * This configuration registers a handler to server webjars.
 */
@Configuration
class RootDispatcherServletConfiguration extends WebMvcConfigurationSupport {

  /** Registers handlers that serve the static content from webjars..
   */
  @Override
  protected void addResourceHandlers(
      final ResourceHandlerRegistry registry) {
    registry.addResourceHandler("/webjars/**")
        .addResourceLocations("classpath:/META-INF/resources/webjars/");
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy