java - Struts2 problem -- values in form not being displayed -
i got following struts2 form in jsp. no values being displayed. can help?
<s:iterator value="bulletins"> <s:if test="approved == false"> <s:form action="approvebulletin" method="post"> <table> <tr> <td colspan="2"><b>from:</b> <s:property value="name" /></td> </tr> <tr> <td colspan="2"><b>subject:</b> <s:property value="subject" /></td> </tr> <tr> <td colspan="2"><b>date:</b> <s:property value="date" /> <br> </td> </tr> <tr> <td colspan="2"><s:property value="note" /> <s:hidden name="id" value="id" /></td> </tr> <tr> <td><s:submit type="button" value="approve" label="approve" action="approvebuletin" /></td> <td><s:submit type="button" value="deny" label="deny" action="denybulletin" /></td> </tr> </table> <br /> </s:form> </s:if> </s:iterator>
this code action class passes iterator jsp.
public string execute() { bulletindao bulletindaoinstance = new bulletindao(); list<bulletin> bulletins = bulletindaoinstance.getallbulletins(); if (bulletins != null) { httpsession session = (httpsession) request.getsession(); session.setattribute("bulletins", bulletins.iterator()); return "success"; } return "failure"; }
are setting "bulletins" iterator in action class before forward?
Comments
Post a Comment