user1060797
user1060797

Reputation: 11

grails - domain class can not be found

I have domain User (in domain dir) and controller UserController (in controller dir).

I have also controller AdminController (in controller/admin dir).

I would like to use User class in AdminController. When I am doing it I have exception that User class can not be found.

So here we have a question. Does AdminController should be able to use User domain or maybe only UserController is able to use User domain?

Let me know what do you think about this and how to solve this problem.

Upvotes: 0

Views: 109

Answers (1)

ataylor
ataylor

Reputation: 66059

If the package of AdminController is different from User, you'll need to import the class. For example:

import User

class AdminController {
    ...
}

Upvotes: 1

Related Questions