Ext success 没有相应

imgfrom.js    

var f = new Ext.FormPanel({
                id : 'f',

                labelAlign : 'top',

                frame : true,
                modal : true,
                url : path + 'upload/testUpload.action',
                bodyStyle : 'padding:0 0 0',
                width : 400,

imgfrom.js	

var f = new Ext.FormPanel({
				id : 'f',
				labelAlign : 'top',
				frame : true,
				modal : true,
				url : path + 'upload/testUpload.action',
				bodyStyle : 'padding:0 0 0',
				width : 400,
				fileUpload : true,
				items : [{
							id : 'upload',
							xtype : 'fileuploadfield',
							fieldLabel : '商品图片上传',
							textField : 'panel',
							name : 'upload',
							inputType : 'file'
						}],
				buttons : [{
					text : '添加',
					handler : function() {
						if (f.getForm().isValid()) {
							f.getForm().submit({
								waitTitle : '请稍候',
								waitMsg : '正在提交表单数据,请稍候...',
								success : function(fr, actions) {
									alert("dd");
									alter(action.result.img);
									Ext.getDom("_vipImg").src = path
											+ "/images/userMobile"
											+ action.result.img;
									if (actions.result.success == true) {
										Ext.MessageBox.alert("系统提示", "修改成功");
										f.setVisible(false);
									} else {
										Ext.MessageBox.alert("系统提示", "连接超时");
									}
								}
							})
						}
					}
				}, {
					text : '关闭',
					handler : function() {
						f.setVisible(false);
					}
				}]
			});

	var w = new Ext.Window({
				id : 'addcW',
				width : 300,
				height : 200,
				frame : true,
				modal : true,
				closeAction : 'hide',
				title : '证件上传',
				items : [f]
			});
});


后台action
    public String execute() throws Exception {
        File[] srcFiles = this.getUpload();
        List<String> successFileList=new ArrayList<String>();
        // 处理每个要上传的文件
        for (int i = 0; i < srcFiles.length; i++) {
            // 根据服务器的文件保存地址和原文件名创建目录文件全路径
            String dstPath = getRealyPath(getSavePath())
                    + "\\" + this.getUploadFileName()[i];
            File dstFile = new File(dstPath);
            if(copy(srcFiles[i], dstFile)){
            	System.out.println(getUploadFileName()[i]);
            	  successFileList.add(getUploadFileName()[i]);
            }
        }
        getRequest().setAttribute("successFileList", successFileList);
        commonality = "{success:true,img:"+getUploadFileName()[0]+"}";
        return SUCCESS;
    }

 

                fileUpload : true,
                items : [{
                            id : 'upload',
                            xtype : 'fileuploadfield',
                            fieldLabel : '商品图片上传',
                            textField : 'panel',
                            name : 'upload',
                            inputType : 'file'
                        }],
                buttons : [{
                    text : '添加',
                    handler : function() {
                        if (f.getForm().isValid()) {
                            f.getForm().submit({
                                waitTitle : '请稍候',
                                waitMsg : '正在提交表单数据,请稍候...',
                                success : function(fr, actions) {
                                    alert("dd");
                                    alter(action.result.img);
                                    Ext.getDom("_vipImg").src = path
                                            + "/images/userMobile"
                                            + action.result.img;
                                    if (actions.result.success == true) {
                                        Ext.MessageBox.alert("系统提示", "修改成功");
                                        f.setVisible(false);
                                    } else {
                                        Ext.MessageBox.alert("系统提示", "连接超时");
                                    }
                                }
                            })
                        }
                    }
                }, {
                    text : '关闭',
                    handler : function() {
                        f.setVisible(false);
                    }
                }]
            });

    var w = new Ext.Window({
                id : 'addcW',
                width : 300,
                height : 200,
                frame : true,
                modal : true,
                closeAction : 'hide',
                title : '证件上传',
                items : [f]
            });
});


后台action
    public String execute() throws Exception {
        File[] srcFiles = this.getUpload();
        List<String> successFileList=new ArrayList<String>();
        // 处理每个要上传的文件
        for (int i = 0; i < srcFiles.length; i++) {
            // 根据服务器的文件保存地址和原文件名创建目录文件全路径
            String dstPath = getRealyPath(getSavePath())
                    + "\\" + this.getUploadFileName()[i];
            File dstFile = new File(dstPath);
            if(copy(srcFiles[i], dstFile)){
                System.out.println(getUploadFileName()[i]);
                  successFileList.add(getUploadFileName()[i]);
            }
        }
        getRequest().setAttribute("successFileList", successFileList);
        commonality = "{success:true,img:"+getUploadFileName()[0]+"}";
        return SUCCESS;
    }
图片上传服务器没有问题.前台就是没有相应

success : function(fr, actions) 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值