grails 3 gsp using domain object constraints failing
<p>In grails 2 we were able to reference the domain object constraints in a gsp as to keep the html 5 configration dry.  On grails 3 (tried both 3.1.10 and 3.2.0.RC1) I get an error for code I tested in grails 2 successfully.  I am trying to reference the constraint matches in the attribute phone and use that for the HTML 5 pattern.  The scaffolding use to generate this code but for Grails 3 the scaffolding generates use the fields plugin so I cannot see that code.  Any ideas?</p>

<p>Here is the domain object code:</p>

<pre><code>class Disruption {

static constraints = {
    phone(matches:/^[0-9]{10}$/, nullable:true)
    email(email:true, nullable:false)
}

String name
String phone
String email
</code></pre>

<p>Here is the gsp code:</p>

<pre><code>    &lt;div class="form-group ${hasErrors(bean: disruption, field: 'phone', 'error')}"&gt;
    &lt;label for="phone" class="control-label col-sm-3"&gt;
        Phone
    &lt;/label&gt;
    &lt;div class="col-sm-2"&gt;
        &lt;g:textField name="phone" style="width: 7em" class="form-control" title="Phone 10 digits" pattern="${disruption.constraints.phone.matches}" maxlength="10" placeholder="##########" value="${disruption.phone}"/&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Here is the exception:</p>

<p>URI
    /disruption/create
Class
    java.lang.NullPointerException
Message
    Request processing failed; nested exception is org.grails.gsp.GroovyPagesException: Error processing GroovyPageView: [views/disruption/create.gsp:92] Error executing tag : Error evaluating expression [disruption.constraints.phone.matches] on line [58]: Cannot get property 'phone' on null object
Caused by
    Cannot get property 'phone' on null object</p>