嗨, friend 们,我正在使用Web服务开发Grails,即rest api是使用java开发的,这些是我的请求和响应
requestBody:
{"color": "Select Color", "size": "Select Size", "fullName": "hg", "address": "g", "shape": "Select Shape", "finish": "Select Finish", "fileUpload": "new file","description": "gh", "telephone_Number": "9900887766", "email_Address": "email_Address", "line1": "ssap newas", "city": "gfdg", "state": "gf", "zip": "null", "ship_address": "g", "ship_line1": "abc xyz", "ship_city": "", "ship_state": "", "ship_zip": "null"};
response :
{"statusCode":"1","referenceNumber":"5","errorCode":null}
现在我希望响应状态代码应打印在.gsp页面上
最佳答案
使用JSON时,您需要通过javascript进行操作,使用jQuery更新将包含状态文本的html元素。但是,使用angularjs可以很容易地完成这些事情。
关于grails - 在Grails应用程序中使用rest api并在gsp页面中打印响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27182151/