Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/08/2008, 10:57
fatimavo
 
Fecha de Ingreso: agosto-2008
Mensajes: 8
Antigüedad: 15 años, 9 meses
Puntos: 0
Exclamación Error argument type mismatch al subir un fichero

Hola!
Estoy intentando subir un fichero al servidor y para ello hago lo siguiente:

En la pagina JSP pongo:

<html:form action="AddImage.do" focus="userIdentifier" method="POST" enctype="multipart/form_data">
...
<html:file property="ficheroSubir"/>
...
</html:form>

Defino en el formulario :

private FormFile ficheroSubir;

public FormFile getFicheroSubir() {
return ficheroSubir;
}

public void setFicheroSubir(FormFile ficheroSubir) {
this.ficheroSubir = ficheroSubir;
}

Y en el action pongo:

AddImageForm addImageForm = (AddImageForm) form;

FormFile formFile=addImageForm.getFicheroSubir();
String contentType=formFile.getContentType();
String fileName=formFile.getFileName();
int fileSize=formFile.getFileSize();
byte[] fileData=formFile.getFileData();

El problema es que cuando cubro el formulario y le doy a submit, me salta un error argument type mismatch
org.apache.commons.beanutils.PropertyUtilsBean.inv okeMethod(PropertyUtilsBean.java:1778)
org.apache.commons.beanutils.PropertyUtilsBean.set SimpleProperty(PropertyUtilsBean.java:1759)
org.apache.commons.beanutils.PropertyUtilsBean.set NestedProperty(PropertyUtilsBean.java:1648)
org.apache.commons.beanutils.PropertyUtilsBean.set Property(PropertyUtilsBean.java:1677)
org.apache.commons.beanutils.BeanUtilsBean.setProp erty(BeanUtilsBean.java:1022)
....

En el log, del tomcat pone que no se puede invocar el metodo getFicheroSubir() del formulario y no se por que?

Alguien me podria echar una mano?

Gracias de antemano