最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

struts2中action實(shí)現(xiàn)ModelDriven后無法返回json的解決方法

 更新時(shí)間:2013年03月06日 15:35:52   作者:  
struts2中action實(shí)現(xiàn)ModelDriven后無法返回json的解決方法,需要的朋友可以參考一下

復(fù)制代碼 代碼如下:

public class DeviceAction extends AbstractAction implements ModelDriven<Device> {
    private static Log log = LogFactory.getLog(DeviceAction.class);
    private Device device=new Device(); //只能json化 模型驅(qū)動(dòng)的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配置:

復(fù)制代碼 代碼如下:

<action name="queryPu"
            class="com.jxj.bss.web.actions.DeviceAction"
            method="queryPu">
            <interceptor-ref name="isLogin"></interceptor-ref>
            <result type="json">
                <param name="includeProperties">
                    resultCode
                </param>
            </result>
        </action>

解決辦法:

復(fù)制代碼 代碼如下:

<action name="queryPu"
            class="com.jxj.bss.web.actions.DeviceAction"
            method="queryPu">
            <interceptor-ref name="isLogin"></interceptor-ref>
            <result type="json">
                <param name="root">action</param>
                <param name="includeProperties">
                    resultCode
                </param>
            </result>
        </action>

相關(guān)文章

最新評(píng)論

德清县| 商城县| 安宁市| 庆阳市| 翼城县| 七台河市| 赤水市| 从江县| 伽师县| 宕昌县| 聂拉木县| 高台县| 宁蒗| 车致| 双江| 丰顺县| 水富县| 云梦县| 渝北区| 营山县| 绥江县| 呈贡县| 广州市| 宜州市| 库伦旗| 乌兰浩特市| 隆德县| 溧阳市| 甘德县| 许昌市| 策勒县| 无棣县| 灵武市| 富锦市| 防城港市| 白城市| 湄潭县| 和林格尔县| 乐亭县| 娄底市| 库尔勒市|