下面列出了怎么用org.springframework.boot.autoconfigure.condition.ConditionalOnNotWebApplication的API类实例代码及写法,或者点击链接到github查看源代码。
@Bean
@ConditionalOnMissingBean(ThymeleafContextConverter.class)
@ConditionalOnNotWebApplication
public ThymeleafContextConverter springStandaloneThymeleafContextConverter(
StaticVariablesProvider staticVariablesProvider,
ThymeleafEvaluationContextProvider thymeleafEvaluationContextProvider,
ContextMerger contextMerger) {
return springThymeleafContextConverter(staticVariablesProvider, thymeleafEvaluationContextProvider, contextMerger);
}
@Bean
@ConditionalOnMissingBean(ThymeleafContextConverter.class)
@ConditionalOnNotWebApplication
public ThymeleafContextConverter springStandaloneThymeleafContextConverter(
StaticVariablesProvider staticVariablesProvider,
ThymeleafEvaluationContextProvider thymeleafEvaluationContextProvider,
ContextMerger contextMerger) {
return springThymeleafContextConverter(staticVariablesProvider, thymeleafEvaluationContextProvider, contextMerger);
}
@Bean
@ConditionalOnNotWebApplication
public AppContext normalAppContext(ApplicationContext applicationContext) {
return this.createAppContext(null, applicationContext);
}