struts2 - Data collection form inputs hidden Struts 2 -
my problem happens when send data hidden fields action. no data collected , result page receive following message:
- error setting expression 'idplatos' value '[ljava.lang.string;@354c0a31'
- error setting expression 'idrestaurantes' value '[ljava.lang.string;@4786b9ce'
in form value of hidden fields come previous query, on same page query other data not in form displayed correctly.this code form:
<s:form action="detalles.action" namespace="/" method="post"> <s:hidden name="idplatos" value="idplatos"/> <s:hidden name="idrestaurantes" value="restaurante.idrestaurante"/> <s:submit key="detalles" align="center"/> </s:form>
this code action:
public class platoaction extends actionsupport { private arraylist <platos> detalles; private int idplatos; private int idrestaurantes; public string execute() throws exception { platos plato = new platos(); restaurantes restaurante = new restaurantes(); plato.setidplatos(getidplatos()); restaurante.setidrestaurantes(getidrestaurantes()); system.out.println("idpla"); system.out.println("idpres"); interfaceplatosdao platosdao = factoriadao.getplatosdao("mysql"); detalles = platosdao.detalleplato(plato, restaurante); return success; } public arraylist<platos> getdetalles() { return detalles; } public void setdetalles(arraylist<platos> detalles) { this.detalles = detalles; } public int getidplatos() { return idplatos; } public void setidplatos(int idplatos) { this.idplatos = idplatos; } public int getidrestaurantes() { return idrestaurantes; } public void setidrestaurantes(int idrestaurantes) { this.idrestaurantes = idrestaurantes; } }
what problem?
Comments
Post a Comment