【发布时间】:2022-07-12 19:59:17
【问题描述】:
我通过服务构建器创建了一个 Rest 服务。
@AccessControlled(guestAccessEnabled = true)
@JSONWebService
public JSONObject feedback(String jsonInfo) throws SystemException, PortalException {....
部署后,服务可以在 api/jsonws 中找到
我尝试调用服务,因为 jsonInfo 很长,我无法将它作为 url 路径的一部分传递。
我尝试将它作为对象传递,就像帮助文档:enter link description here
<form method="post" action="http://localhost:8080/api/jsonws/snm.record/feedback/+json-info">
<input type="hidden" name="+json-info" value="test"/>
<button type="submit" >submit</button>
</form>
服务已被调用,但 jsonInfo 总是为空。 如果没有加号(+),则丢失。
{"exception":"参数缺失值 json-info","throwable":"java.lang.IllegalArgumentException: 缺失 参数值 json-info","error":{"message":"缺失值 参数 json-info","type":"java.lang.IllegalArgumentException"}}
我不知道我错过了什么,请帮忙。
提前致谢。
【问题讨论】: