0
我在spring-boot项目中添加了一些自定义的thymeleaf方言和处理器,包:org.store.custom.thymeleaf.dialect和org.store.custom.thymeleaf.processor。在我的html页面中,我以这种方式配置命名空间:自定义thymeleaf标签的XML命名空间
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
xmlns:form="http://form"
xmlns:field="http://field">
它不工作。 xmlns:form和xmlns:field的正确值应该是什么,以使基于它们的标签有效?
UPDATE
的thymeleaf配置是这样的:
@Configuration
public class Thymeleaf {
@Bean
public SpringTemplateEngine templateEngine() {
SpringTemplateEngine engine = new SpringTemplateEngine();
final Set<IDialect> dialects = new HashSet<IDialect>();
dialects.add(new SpringSecurityDialect());
dialects.add(new FormDialect());
dialects.add(new FieldDialect());
engine.setDialects(dialects);
return engine;
}
}
我不是专家,我不知道正确的答案,但我把它空('的xmlns:形式=“”'),它作品。也许你的问题在于配置。 – Pablo 2014-12-10 22:12:48