Using JSON-RPC in Struts2

泄露秘密 提交于 2019-12-06 12:09:38

Is it mandatory to have only the POST request while using JSON-RPC?

yes, it only works with POST request

Also includeProperties has no effect

includeProperties has effect if it's a parameter to json interceptor. Don't confuse the name of parameter used with json result.

the field dob in this case, should have been excluded

In this case better to use excludeProperties parameter to interceptor, like this

@Action(value = "testJsonAction",
results = {
    @Result(type = "json", params = {"enableSMD", "true"})},
interceptorRefs = {
    @InterceptorRef(value = "json", params = {"enableSMD", "true", "excludeProperties", "result\\.dob"})})
public String executeAction() throws Exception {
    return SUCCESS;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!