how to get only particular fields in response in struts2

后端 未结 1 385
再見小時候
再見小時候 2020-12-03 20:14

I have an action class in which many action methods are defined and appropriate getters and setters methods are also defined. I have some action methods from which I get the

相关标签:
1条回答
  • 2020-12-03 21:05

    By default json result serializes all bean properties specified by the root parameter which is set by default to the action. But you can use includeProperties parameter of the result to filter only those properties from the root that matched regex expressions.

    @Result(type="json", params = {"includeProperties", "^s2"})
    
    0 讨论(0)
提交回复
热议问题