Upload Struts

0 respostas
ACDias

Alguém sabe como funciona essa bagaça de upload no Struts???
Já segui um milhão de exemplos... Fiz exatamente como todos e nunca funciona.

jsp
<html:form action="/admin/news" enctype="multipart/formdata" method="post">
<label for="imgFile">Imagem cabeçalho</label>
		<html:file property="imgFile" styleId="imgFile" />
</html:form>
Struts-config
<form-bean name="FB_News" type="br.com.cedro.forms.FB_News"/>
<action input=".view.admin.news" name="FB_News" path="/admin/news" type="br.com.cedro.actions.NewsAction">
   <forward name="success" path=".view.admin.news"/>
  </action>
ActionForm
public class FB_News extends ActionForm {
	private ActionErrors errors;

	private FormFile imgFile;
...
Está dando esta exception quando submeto o form
org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'java.lang.String' to property 'imgFile' of type 'org.apache.struts.upload.FormFile'

Obrigado.

Criado 2 de outubro de 2008
Respostas 0
Participantes 1