I have built an application very similar to the Employee example in the book. However, the data does not display in the JSP page.
My JSP page looks like this
Code:
<logic:iterate id="record" name="searchrecords">
<tr>
<td width="95"><input name="submit" type="Badge Num" /> </td>
<td width="115" class="style2"><bean:write name="record" property="ar_empno"/></td>
My strut-config looks like this
Code:
<action path="/searchList"
type="com.cta.acctTerm.web.action.SearchListAction"
name="recordSearchFormBean"
parameter="operation"
scope="request">
<forward name="back" path="/recordsearch.jsp"/>
<forward name="success" path="/searchList.jsp"/>
<forward name="failure" path="/error.jsp"/>
</action>
My Action looks like this
Code:
public ActionForward add(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
modelFacade = new ModelDAOFacade();
RecordSearchFormBean saveBean = (RecordSearchFormBean)form;
String ar_empno = saveBean.getar_empno();
ArrayList searchrecords = new ArrayList();//modelFacade.recordSearchLast(ar_last);
AccountRecord record = new AccountRecord();
record.setar_empno("9999");
record.setar_first("TEST");
searchrecords.add(record);
request.setAttribute("searchrecords", searchrecords);
return(mapping.findForward("success"));
}
However, my data does not display. I am sure the searchrecords data is being populated into the request.
Any ideas will be much appreciated.
On another note, is there a working version of the code that we can deploy as an example? I have tried for over a week to get this to work and am beginning to wonder if the book missed out on some information.
Thanks in advance for any information.