Python语言技术文档

微信小程序技术文档

php语言技术文档

jsp语言技术文档

asp语言技术文档

C#/.NET语言技术文档

html5/css技术文档

javascript

点击排行

您现在的位置:首页 > 技术文档 > jsp框架

struts2中action实现ModelDriven后无法返回json的解决方法

来源:中文源码网    浏览:339 次    日期:2024-05-17 02:54:52
【下载文档:  struts2中action实现ModelDriven后无法返回json的解决方法.txt 】


struts2中action实现ModelDriven后无法返回json的解决方法
复制代码 代码如下:public class DeviceAction extends AbstractAction implements ModelDriven { 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配置:
复制代码 代码如下: resultCode
解决办法:
复制代码 代码如下: action resultCode

相关内容