HTML5 Validation Dialect - Custom validation rules

In order to add a custom validation rule you have to implement the ValidationPerformer interface and add it to the configuration:

<bean id="html5ValDialect" class="net.sourceforge.html5val.Html5ValDialect">
<property name="additionalPerformers">
<set>
<bean class="net.sourceforge.html5val.examples.MyCustomPerformer" />
</set>
</property>
</bean>
<bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" />
<property name="dialects">
<set>
<bean class="org.thymeleaf.spring3.dialect.SpringStandardDialect" />
<ref bean="html5ValDialect" />
</set>
</property>
</bean>


Back to home page