复制代码 代码如下:
public class DeviceAction extends AbstractAction implements ModelDriven<Device> {
private static Log log = LogFactory.getLog(DeviceAction.class);
private Device device=new Device(); //只能json化 模型驱动的bean
private String result; //无法返回reslut的json值
public String getResult(){
return result;
}
public void setResult(String result){
this.result=result
}
public DeviceDTO getModel() {
return device;
}
public Device getDevice() {
return device;
}
public void setDevice(Device device) {
this.device = device;
}
}
xml配置:
复制代码 代码如下:
<action
method="queryPu">
<interceptor-ref></interceptor-ref>
<result type="json">
<param>
resultCode
</param>
</result>
</action>
解决办法:
复制代码 代码如下:
<action
method="queryPu">
<interceptor-ref></interceptor-ref>
<result type="json">
<param>action</param>
<param>
resultCode
</param>
</result>
</action>
新闻热点
疑难解答