Erro com Data usando Strutus (beanUtils.copyProperties(toBean, fromBean)

1 resposta
A

Em um projeto que estou desenvolvendo, estou com erro ao tentar passar uma data do Form (jsp) para um Bean. Se alguém puder me ajudar, agradeço. Segue abaixo as principais configurações:

Strusts confirg

BEAN VO

public Date data;
public double uss;

/**

* @return Returns the data.

<em>/

public Date getData()

{

return data;

}

/</em>*

* @param codigo The data to set.

*/

public void setData(Date data)

{

this.data = data;

}

/**-

* @return Returns the uss.

*/

public double getUss()

{

return uss;

}

Do JSP para O BEAN estou usando a função beanUtils.copyProperties(toBean, fromBean);

Mensagem de erro:

CadastroMoedasVO.setData - argument type mismatch

ERROR PropertyUtils Method invocation failed.

java.lang.IllegalArgumentException: argument type mismatch

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)

at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)

at org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:467)

at org.apache.commons.beanutils.BeanUtilsBean.copyProperties(BeanUtilsBean.java:238)

at org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:114)

at br.com.roder.commons.foundation.GeneralUtils.copyProperties(GeneralUtils.java:25)

at br.com.roder.faturamento.actions.CadastroMoedasAction.search(CadastroMoedasAction.java:352)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

Desde já agradeço pela atenção

1 Resposta

Alexandre_Vilas_Boas

Esse link deve ajudar

BeanUtils, Digester, and Type Conversion

[]'s

Criado 20 de abril de 2007
Ultima resposta 20 de abr. de 2007
Respostas 1
Participantes 2