com.labbol.cocoon.configuration.CocoonConfiguration Maven / Gradle / Ivy
/**
*
*/
package com.labbol.cocoon.configuration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.labbol.cocoon.Cocoon;
import com.labbol.cocoon.exception.CocoonExceptionResolver;
import com.labbol.cocoon.path.ProjectPathSetServletContextListener;
import com.labbol.core.Labbol;
/**
* @author pengfei
* @date 2019年12月12日上午11:10:38
*/
@Configuration
@ConditionalOnProperty(prefix = Labbol.LABBOL_PROPERTIES_PREFIX,
name = "devMode",
havingValue = "cocoon",
matchIfMissing = false)
public class CocoonConfiguration {
/**
* 异常处理器
* @date 2019年12月13日上午9:38:52
* @return
*/
@ConditionalOnMissingBean(CocoonExceptionResolver.class)
@Bean
public CocoonExceptionResolver cocoonExceptionResolver() {
return new CocoonExceptionResolver();
}
/**
* @return 项目路径配置
*/
@Bean
@ConditionalOnProperty(prefix = Cocoon.COCOON_PROPERTIES_PREFIX,
name = "projectPath",
havingValue = "true",
matchIfMissing = false)
public ProjectPathSetServletContextListener projectPathSetServletContextListener() {
return new ProjectPathSetServletContextListener();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy