问题描述
1.这是java方法:需要传一个UserBean对象publicStringaddUser(UserBeanuser)2.dwr配置<convertconverter="bean"match="cn.iaspec.security.web.organize.UserBean"><paramname="include"value="userId,userName,userIndex,userType,isUseable,lastLoginTime,policeNum,remark,isDelete,roleList,deptList,deptId,roleStr,isMaster,loanNum,userPhone,duty,allRoleStr,seeSecrecy,deptName,jzzphotoup,IS_SLD"/></convert>3.前台页面<inputname="jzzphotoup"type="file"class="datetime"size="10"onchange="document.getElementById('jzzphoto').src=this.value"accept="image/jpg;image/bmp">提交方法:functionaddUser(){varvar_remark=document.getElementsByName("remark")[0].value.replace(/^s+|s+$/g,"");varvar_userId=document.getElementsByName("userId")[0].value.replace(/^s+|s+$/g,"");varvar_userName=document.getElementsByName("userName")[0].value.replace(/^s+|s+$/g,"");varvar_policeNum=document.getElementsByName("policeNum")[0].value.replace(/^s+|s+$/g,"");varvar_duty=document.getElementsByName("duty")[0].value.replace(/^s+|s+$/g,"");varvar_telNum=document.getElementsByName("userPhone")[0].value.replace(/^s+|s+$/g,"");varjzzphotoup=dwr.util.getValue("jzzphotoup");[0].value.replace(/^s+|s+$/g,"");alert(dwr.util.getValue("jzzphotoup"));varIS_SLD=document.getElementsByName("IS_SLD")[0].value.replace(/^s+|s+$/g,"");varvar_seeSecrecy="";varseeSecrecy=document.getElementsByName("seeSecrecy")[0];data={deptId:var_deptId,userId:var_userId,userName:var_userName,policeNum:var_policeNum,remark:var_remark,roleStr:str_role,userPhone:var_telNum,duty:var_duty,userType:var_userType,seeSecrecy:var_seeSecrecy,jzzphotoup:jzzphotoup,IS_SLD:IS_SLD};OrganizeManageAjax.addUser(data,callbackadduser);}问题来了UserBean对象中有一个字段jzzphotoup是:privateFilejzzphotoup;//人员照片是File类型的,前台传参数时就报错了:[DefaultConverterManager]Missingconverter.Contextofconversion:PropertyDescriptorProperty[jzzphotoup=classjava.io.File]请教高手,不知道这个File对象的字段是怎么传的啊,总是报错,还是dwr根本就不能传这种File类型的数据呢,有没有别的解决方法呀