When a jpa entity with a Boolean has a web mvc scaffold generated then the field:checkbox jspx file has a "validationMessageCode" attribute that is undefined
The jspx
The Java attribute:Code:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"> <jsp:directive.page contentType="text/html;charset=UTF-8" /> <jsp:output omit-xml-declaration="yes" /> <form:create id="fc_com_kn_core_domain_KnEmailSource" modelAttribute="knEmailSource" path="/email" render="${empty dependencies}" z="dTLrpRuDVRJ5mrhIoIgQCZ2vM88="> <field:checkbox field="emailAllowed" id="c_com_kn_core_domain_KnEmailSource_emailAllowed" validationMessageCode="field_invalid_email" z="wTN+Jq4iS1yreKGSzQx31kMngEI=" /> ...
The runtime error...Code:@RooJavaBean @RooToString @Buildable @RooJpaActiveRecord public class KnEmailAccount { private Boolean emailAllowed; }
Of course, removing validationMessageCode="field_invalid_email" is the workaroundCode:Nov 29, 2011 11:27:46 PM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /WEB-INF/views/email/create.jspx(10,182) Attribute validationMessageCode invalid for tag checkbox according to TLD at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236) at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1235) at org.apache
I figure this is a bug, I'll open a JIRA issue if somebody can confirm it.
thanks,
Mark


