diff --git a/examples/springboot/src/main/resources/config/application.yml b/examples/springboot/src/main/resources/config/application.yml index d25f8b4..492350a 100644 --- a/examples/springboot/src/main/resources/config/application.yml +++ b/examples/springboot/src/main/resources/config/application.yml @@ -8,7 +8,7 @@ spring: sitemesh: decorator: metaTag: decorator -# bundles: sm2 +# tagRuleBundles: org.sitemesh.content.tagrules.html.Sm2TagRuleBundle exclusions: /assets/* mappings: - path: /* diff --git a/spring-boot-starter-sitemesh/src/main/java/org/sitemesh/autoconfigure/SiteMeshAutoConfiguration.java b/spring-boot-starter-sitemesh/src/main/java/org/sitemesh/autoconfigure/SiteMeshAutoConfiguration.java index 227b2c7..de30701 100644 --- a/spring-boot-starter-sitemesh/src/main/java/org/sitemesh/autoconfigure/SiteMeshAutoConfiguration.java +++ b/spring-boot-starter-sitemesh/src/main/java/org/sitemesh/autoconfigure/SiteMeshAutoConfiguration.java @@ -20,6 +20,7 @@ import org.sitemesh.config.ConfigurableSiteMeshFilter; import org.sitemesh.config.MetaTagBasedDecoratorSelector; import org.sitemesh.config.RequestAttributeDecoratorSelector; +import org.sitemesh.content.tagrules.TagRuleBundle; import org.sitemesh.content.tagrules.html.Sm2TagRuleBundle; import org.sitemesh.webapp.WebAppContext; import org.springframework.beans.factory.annotation.Value; @@ -52,7 +53,7 @@ public void setMappings(List> mappings) { private String prefix; @Value("${sitemesh.decorator.metaTag:decorator}") private String metaTagName; - @Value("${sitemesh.decorator.bundles:}") + @Value("${sitemesh.decorator.tagRuleBundles:}") private List bundles; @Value("${sitemesh.decorator.attribute:}") private String attribute; @@ -87,9 +88,7 @@ protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) { } } for (String bundle : bundles) { - if (bundle.trim().equals("sm2")) { - builder.addTagRuleBundle(new Sm2TagRuleBundle()); - } + builder.addTagRuleBundle((TagRuleBundle) getObjectFactory().create(bundle)); } builder.setIncludeErrorPages(includeErrorPages); }