mar*_*rko 2 java eclipse grails json
我有以下设置,grails 2.0.3,STS,我在我的一个控制器中执行此操作:
render(['car': contactL] as JSON)
Run Code Online (Sandbox Code Playgroud)
当我运行该应用程序时,我收到以下错误:
我已经阅读了有关错误的信息,但没有一个解决方案对我有用,我尝试过清理,升级,使用Grails工具 - >刷新依赖关系,但它给了我:
grails> | Error Error running script null: Cannot invoke method trim() on null object (Use --stacktrace to see the full trace)
Run Code Online (Sandbox Code Playgroud)
我在我的项目中也遇到了这个错误:
The project was not built since its build path is incomplete. Cannot find the class file for groovy.lang.GroovyObject. Fix the build path then try building this project Ristretto Unknown Java Problem
Run Code Online (Sandbox Code Playgroud)
你诊断的是什么?
Rob*_*ska 13
要修复"无法解析类JSON"错误,您只需要导入它:
import grails.converters.JSON
...
class MyController {
...
render [car: contactL] as JSON
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6226 次 |
| 最近记录: |