-1

I have a domain class which contains a Class[] array. I want the contents of that array displayed using g:select. Although I cannot find how to access those fields. I tried <%@page import="package.path.to.PropertyDefinition" %> and then

<g:select from="${PropertyDefinition.types}" name="cust_prop_type"/>

Although I am getting a very big exception of type org.codehaus.groovy.control.MultipleCompilationErrorsException

Is it possible to access that static Array without making use of a Controller class?

I am using version 2.3.7

class PropertyDefinition {

     @Transient
    public static final Class[] validTypes = [Integer.getClass(), String.getClass(), RefdataValue.getClass(), BigDecimal.getClass()]
.
.
.

Exception:

Caused by: java.lang.NullPointerException at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodGetParameterAnnotations(ReflectiveInterceptor.java:944) at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:357) at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:258) at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:353) at org.codehaus.groovy.ast.ClassNode.declaresInterface(ClassNode.java:945) at org.codehaus.groovy.ast.ClassNode.implementsInterface(ClassNode.java:925) at org.codehaus.groovy.ast.ClassNode.isDerivedFromGroovyObject(ClassNode.java:915) at org.codehaus.groovy.classgen.AsmClassGenerator.isGroovyObject(AsmClassGenerator.java:937) at

Abhineet Verma
  • 1,008
  • 8
  • 18
Giannis
  • 5,286
  • 15
  • 58
  • 113

1 Answers1

4

You've declared

public static final Class[] validTypes

in PropertyDefinition but you're accessing PropertyDefinition.types in the GSP...

Ian Roberts
  • 120,891
  • 16
  • 170
  • 183
  • Jaw dropped while reading this. The stupidity of the mistake is too damn high. http://s3.amazonaws.com/rapgenius/tumblr_lq98myTmBo1qcnum8.jpg – Giannis Jun 25 '14 at 09:46