用org.apache.struts.upload.FormFile;上传文件时,出现如下错误!!!!!!!!!
java.lang.IllegalArgumentException: argument type mismatch
Form 如下:
public class ImageForm extends ActionForm{
private int fpicID;
private String fname;
private String fcode;
private int fportalID;
private int fsourceID;
private int fileTypeID;
private int fheight;
private int fwidth;
private int fkindID;
private int ftypeID;
private int fstyleID;
private String fcreatedate;
private int fcreatorname;
private String fcreatorID;
private FormFile fblob;
private byte[] picBlob;
/**
* @return 返回 fblob。
*/
public FormFile getFblob() {
return fblob;
}
/**
* @param fblob 要设置的 fblob。
*/
public void setFblob(FormFile fblob) {
this.fblob = fblob;
try {
InputStream in = fblob.getInputStream();
this.picBlob = new byte[in.available()];
in.read(picBlob);
in.close();
} catch (Exception e) {
//log.error("[系统错误]录入文件有问题:" + e.getMessage());
}
}
/**
* @return 返回 fcode。
*/
public String getFcode() {
return fcode;
}
/**
* @param fcode 要设置的 fcode。
*/
public void setFcode(String fcode) {
this.fcode = fcode;
}
/**
* @return 返回 fcreatedate。
*/
public String getFcreatedate() {
return fcreatedate;
}
/**
* @param fcreatedate 要设置的 fcreatedate。
*/
public void setFcreatedate(String fcreatedate) {
this.fcreatedate = fcreatedate;
}
/**
* @return 返回 fcreatorID。
*/
public String getFcreatorID() {
return fcreatorID;
}
/**
* @param fcreatorID 要设置的 fcreatorID。
*/
public void setFcreatorID(String fcreatorID) {
this.fcreatorID = fcreatorID;
}
/**
* @return 返回 fcreatorname。
*/
public int getFcreatorname() {
return fcreatorname;
}
/**
* @param fcreatorname 要设置的 fcreatorname。
*/
public void setFcreatorname(int fcreatorname) {
this.fcreatorname = fcreatorname;
}
/**
* @return 返回 fheight。
*/
public int getFheight() {
return fheight;
}
/**
* @param fheight 要设置的 fheight。
*/
public void setFheight(int fheight) {
this.fheight = fheight;
}
/**
* @return 返回 fileTypeID。
*/
public int getFileTypeID() {
return fileTypeID;
}
/**
* @param fileTypeID 要设置的 fileTypeID。
*/
public void setFileTypeID(int fileTypeID) {
this.fileTypeID = fileTypeID;
}
/**
* @return 返回 fkindID。
*/
public int getFkindID() {
return fkindID;
}
/**
* @param fkindID 要设置的 fkindID。
*/
public void setFkindID(int fkindID) {
this.fkindID = fkindID;
}
/**
* @return 返回 fname。
*/
public String getFname() {
return fname;
}
/**
* @param fname 要设置的 fname。
*/
public void setFname(String fname) {
this.fname = fname;
}
/**
* @return 返回 fpicID。
*/
public int getFpicID() {
return fpicID;
}
/**
* @param fpicID 要设置的 fpicID。
*/
public void setFpicID(int fpicID) {
this.fpicID = fpicID;
}
/**
* @return 返回 fportalID。
*/
public int getFportalID() {
return fportalID;
}
/**
* @param fportalID 要设置的 fportalID。
*/
public void setFportalID(int fportalID) {
this.fportalID = fportalID;
}
/**
* @return 返回 fsourceID。
*/
public int getFsourceID() {
return fsourceID;
}
/**
* @param fsourceID 要设置的 fsourceID。
*/
public void setFsourceID(int fsourceID) {
this.fsourceID = fsourceID;
}
/**
* @return 返回 fstyleID。
*/
public int getFstyleID() {
return fstyleID;
}
/**
* @param fstyleID 要设置的 fstyleID。
*/
public void setFstyleID(int fstyleID) {
this.fstyleID = fstyleID;
}
/**
* @return 返回 ftypeID。
*/
public int getFtypeID() {
return ftypeID;
}
/**
* @param ftypeID 要设置的 ftypeID。
*/
public void setFtypeID(int ftypeID) {
this.ftypeID = ftypeID;
}
/**
* @return 返回 fwidth。
*/
public int getFwidth() {
return fwidth;
}
/**
* @param fwidth 要设置的 fwidth。
*/
public void setFwidth(int fwidth) {
this.fwidth = fwidth;
}
/**
* @return 返回 picBlob。
*/
public byte[] getPicBlob() {
return picBlob;
}
/**
* @param picBlob 要设置的 picBlob。
*/
public void setPicBlob(byte[] picBlob) {
this.picBlob = picBlob;
}
public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) {
// TODO Auto-generated method stub
return super.validate(arg0, arg1);
}
}
如果把private FormFile fblob;去掉就无问题!!