Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 60793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:13:03+00:00 2026-05-10T18:13:03+00:00

The code ${personRequest.constraints.requestStatus.inList} in my gsp file throws a NullPointerException , but new PersonRequest().constraints..

  • 0

The code

${personRequest.constraints.requestStatus.inList} 

in my gsp file throws a NullPointerException, but new PersonRequest().constraints.. works. Why? Isn’t constraints static?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:13:04+00:00Added an answer on May 10, 2026 at 6:13 pm

    Copied from here (grails-user mailing list)

    but why accesing to static fields doesnt work?

    Because the ‘constraints’ static field is a closure property. It has no sub-properties relating to the constraints.

    Grails evaluates this closure using a constraint builder which monitors ‘calls’ to methods that don’t exist, i.e. the property names you use:

    type( inList: [xxxxx]) 

    …causes a method call to ‘type’ with a Map parameter containing ‘inList’ ==> some value.

    From this info, Grails builds up a list of all the constraints
    available and binds them to future instances of the domain class.

    So, when you access User.constraints statically, you are getting a
    Closure.

    We -could- look at replacing the value of the static constraints property at runtime after evaluating the Closure it is initialized with. However this could be a bit ‘too much’ magic. What do people think?

    FYI it’s like this now because until 0.4 (if I recall) constraints weren’t static, and in 0.4 they can still be non-static. Only in 0.5
    will we throw an exception/ignore non-static constraints.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

code: <a href=...><img src=..' /><span>..</span></a> works fine in all cases, but <a href=...> <img
Code below does not run correctly and throws InvalidOperationExcepiton . public void Foo() {
code inside php file: $variable1 = array( 'variable1' => $variable1 ); $variable2 = array(
code: public class Main{ public static void main(String[] a){ long t=24*1000*3600; System.out.println(t*25); System.out.println(24*1000*3600*25); }
Code # get already active Excel application or open new my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
code : SqlConnection sqlc = new SqlConnection( Data Source= + Environment.MachineName + @\SQLEXPRESS; +
Code below works well on Firefox - displays progress bar which progresses on every
CODE:1 class Ajay { private void display() { System.out.println(Ajay); } public static void main(String
Code: http://pastie.org/1961455 Trackback: Traceback (most recent call last): File C:\Users\COMPAQ\Desktop\NoughtsCrosses.py, line 149, in <module>
Code: static int counter = 0; int add(int x) { counter++; return ++x; }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.