对不起,我真的不知道如何总结这个问题的标题。所以,标题可能不清楚。在struts'json中只传递一个类的一部分属性
我有一个执行一些业务逻辑的操作类。
在Action类:
class ActionClass extends ActionSupport{
private Merchandise merchandise;// I want to transfer it to the client
//setter and getter
}
在商品类
:
class Merchandise{
private String name; // I want to transfer it
private String price; //I don't want to transfer it
private String description;//I don't want to transfer it
//setter and getter
}
现在,我需要将商品财产ActionClass传送到客户端。
然而,在商品财产,我要同时抑制其他两个属性仅传送名财产。
那么如何抑制商品类中其他两个属性(价格和描述)的转移?
你能解释更多的“我要过滤这些属性和转让只是其中的一部分,”如果可能的话 – anu