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 6061141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:54:17+00:00 2026-05-23T08:54:17+00:00

I just added the spring security plugin to my grails application. I have a

  • 0

I just added the spring security plugin to my grails application. I have a question about adding users and their associated roles. I am able to do it correctly in the bootstrap but was wondering how to do it in the GSP page. I have a gsp page with the corresponding fields. when submited, it call the save method. my user domain controller extends SecUser. below is the example:

class User extends SecUser {

    String  fname
    String  lname
    Date    dateCreated
    Date    lastUpdated

    static constraints = {
        fname       (blank:false)
        lname       (blank:false)
    }
    String toString(){
        fname & " " & lname
    }
}

When the user is saved, it saves only items in the user domain, not the SecUser. Does anyone have an example GSP and controller code to save the all the user data?

  • 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-23T08:54:18+00:00Added an answer on May 23, 2026 at 8:54 am

    I perceive that you have two problems :

    1. How to create a Crud (including gsp) on your User class
    2. How to persist the data on your class and its inherited fields

    For the first question:
    To create GSPs and everything you need to have a CRUD on your User class, I suggest that you use scaffolding. If will take care of all of this for you.

    Remove everything from your UserController or create another controller with only the following code:

    class UserController {
        static scaffold = User
    }
    

    then, navigate to your UserController ({your_app}/user/index) and everything should be there.

    If you want to have an actual controller and gsps and modify how they work, use the grails command :grails generate-all your.package.User

    For the second question :

    Unless there is a problem with your SecUser class (transient fields for example), all fields inherited from SecUser should be saved through a User.save()

    Let me know how it goes,

    Vincent Giguère

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

Sidebar

Related Questions

I have just added a Core Plot view to my application based on a
I have just added a Telerik menu to my MVC application. I also have
I wanted to use MongoDB in my Grails application and also Spring Security. I
What's wrong with sqlite 3 ? I have just added libsqlite3 file to my
I programatically create an NSToolbar in my application. I just added a new button
I have a spring application that has configured log4j (via xml) and that runs
I have been dealing with FTP lately and I'm not sure about the security
I have the default membership table that was added automatically, then just used server
I just added a registration functionality to my new grails project. For testing it,
I'm very new in spring and have just downloaded sts 2.7.2 and installed it

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.