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

  • SEARCH
  • Home
  • 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 6882607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:16:29+00:00 2026-05-27T05:16:29+00:00

My controller has this (testing) code: println domainInstance.hasErrors() render (view: edit, model: [domainInstance: domainInstance])

  • 0

My controller has this (testing) code:

println domainInstance.hasErrors()
render (view: "edit", model: [domainInstance: domainInstance])

the println prints false to the console, but the gsp renders errors using <g:hasErrors>.

Why would this be happeining?

  • 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. Editorial Team
    Editorial Team
    2026-05-27T05:16:30+00:00Added an answer on May 27, 2026 at 5:16 am

    It would help if you showed the GSP code, but my guess is that hasErrors() returns true, because you haven’t called validate().

    The hasErrors() method doesn’t perform validation, but just reports whether errors were detected the last time validation was performed. So I suspect that some time after the call to hasErrors() and before the call to <g:hasErrors> validation is being performed.

    Anyhow, if you replace the call to

    println domainInstance.hasErrors()
    

    with

    println domainInstance.validate()
    

    that should fix it

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

Sidebar

Related Questions

I have a strongly typed view, Edit, with a model named OrderModel. In this
I am very confused the View and corresponding controller has to be set in
In my IB I have a navigation controller which has in it a view
I have the problem that my view controller class has too many delegates and
I'm struggling to create a table view controller that has anything more than just
I have a navigation controller which also has a table view. I want to
I have a view controller class that has to implement several protocols. Too keep
My view has a CATiledLayer . The view controller has custom zooming behavior, so
I've got controller code like this all over my ASP.NET MVC 3 site: [HttpPost]
I have a controller which has a method called history class UsersController < ApplicationController

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.