我在我的 struts 动作中添加了这个方法,
public String execute() {
long start = System.currentTimeMillis();
simDetails = new SIMDetails();
return GET_SIM_DETAILS;
}
并在 struts 配置文件中添加以下操作,
<result type="json" name="getSIMDetails">
<param name="noCache">true</param>
<param name="includeProperties">simDetails.*</param>
</result>
然后我得到以下 JSON 响应
{
"simDetails": {
"void": null,
"ban": null,
"currentTariff": null,
"currentTariffDescription": null,
"defaultTariff": null,
"defaultTariffDescription": null,
"imsi": null,
"packageItemId": null,
"simSerialNumber": null,
"simStatus": null,
"simStatusCC": null,
"status": null,
"subscriberNumber": null,
"subsidaryCode": null
}
}
但我需要这个回应而不是上面的,
{
"void": null,
"ban": null,
"currentTariff": null,
"currentTariffDescription": null,
"defaultTariff": null,
"defaultTariffDescription": null,
"imsi": null,
"packageItemId": null,
"simSerialNumber": null,
"simStatus": null,
"simStatusCC": null,
"status": null,
"subscriberNumber": null,
"subsidaryCode": null
}
在不将上述字段添加到我的操作类的情况下获得所需响应的任何想法。