Results 1 to 2 of 2

Thread: Boolean attribute generates undefined "validationMessageCode" attribute for web mvc

  1. #1
    Join Date
    Mar 2008
    Location
    Portland OR
    Posts
    44

    Default Boolean attribute generates undefined "validationMessageCode" attribute for web mvc

    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
    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 Java attribute:
    Code:
    @RooJavaBean
    @RooToString
    @Buildable
    @RooJpaActiveRecord
    public class KnEmailAccount {    
         private Boolean emailAllowed;
    }
    The runtime error...

    Code:
    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
    Of course, removing validationMessageCode="field_invalid_email" is the workaround

    I figure this is a bug, I'll open a JIRA issue if somebody can confirm it.

    thanks,

    Mark

  2. #2
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    668

    Default

    Logged as ROO-2957; please continue the discussion there.
    Andrew Swan
    "Now is the EJB of our discontent made glorious Spring"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •