我试图使用" :spring-security-core:2.0-RC2 "(使用Grails版本2.3.1),但拥有自己的LoginController.groovy.按照Burt的说明(这里和这里),我从" myapp\target\work\plugins\spring-security-core-2.0-RC2\grails-app\controllers\grails\plugin\springsecurity "的原始位置复制了LoginController.groovy."到我的项目位置" myapp\grails-app\controllers\com\company ".现在我收到一堆导入错误消息,如" Groovy:无法解析类... "(我已经附上了上面的图片,显示所有导入错误的导入).我该如何处理这些错误?
很抱歉,如果这是一个微不足道的问题(仍然习惯Grails),谢谢你的帮助!

看起来这已经被问过很多次了,我已经研究了其中的几个,包括Peter Ledbrook的“ GORM Gotchas(第 2 部分) ”,但在我的情况下似乎仍然无法弄清楚。我有一个user其中有很多projects,一个project属于一个user。然后有一个skill其中有许多projects与它相关联,但project不属于skill。当我尝试project从 a 中删除 a 时,出现user该错误。域类如下:
打包 grailstuts
类用户{
字符串名称
静态约束 = { name(nullable: true) }
静态映射 = { 项目级联:“all-delete-orphan”}
静态 hasMany = [ 项目:项目 ]
}
打包 grailstuts
类项目{
字符串标题
静态约束 = { 标题(可为空:真)}
静态属于 = [ 用户:用户 ]
}
打包 grailstuts
类技能{
字符串名称
静态约束 = { name(nullable: true) }
静态映射 = { 项目级联:“all-delete-orphan”} … 我想使用字典本身来评估字典键的值。例如:
dict_ = {'x': 1, 'y': 2, 'z':'x+y'}
dict_['z'] = eval(dict_['z'], dict_)
print(dict_)
Run Code Online (Sandbox Code Playgroud)
当我这样做时,它在字典中包含了一堆不必要的东西。在上面的例子中,它打印:
{'x': 1, 'y': 2, 'z': 3, '__builtins__': bunch-of-unnecessary-stuff-too-long-to-include
Run Code Online (Sandbox Code Playgroud)
Instead, in the above example I just want:
{'x': 1, 'y': 2, 'z': 3}
Run Code Online (Sandbox Code Playgroud)
How to resolve this issue? Thank you!