Hi All,
I have an issue with <logic:iterate> tag when iteration over a List object.
Here is what i have.
##############################
Action Form:
public class ABCForm extends ActionForm{
public List priceBeanList;
public List getPriceBeanList() {
return priceBeanList;
}
public void setPriceBeanList(List priceBeanList1) {
this.priceBeanList = priceBeanList;
}
}
##############################
JSP:
<logic:iterate id="priceBeanList1" name="createAddonUIForm" property="priceBeanList1" type="rezadmin.bean.PackagePriceBean" indexId="i1">
<td>
<table>
<tr>
<td height="10" valign="top"> <bean:write name="priceBeanList1" property="day1"/></td></tr>
<tr>
<td height="10" valign="top"> <bean:write name="priceBeanList1" property="date1" /></td></tr>
<tr>
<td height="10" valign="top"> <bean:write name="priceBeanList1" property="adultRate" /></td></tr>
<tr>
<td height="10" valign="top"> <bean:write name="priceBeanList1" property="childRate" /></td></tr>
<tr>
<td height="20" valign="top">
<html:select name="priceBeanList1" property="numberOfAdults" indexed="true" >
<html
ption value="">-</html
ption>
<html
ption value="1">1</html
ption>
<html
ption value="2">2</html
ption>
<html
ption value="3">3</html
ption>
</html:select></td></tr>
<tr>
<td height="20" valign="top">
<html:select name="priceBeanList1" property="numberOfChildren" indexed="true">
<html
ption value="">-</html
ption>
<html
ption value="1">1</html
ption>
<html
ption value="2">2</html
ption>
<html
ption value="3">3</html
ption>
</html:select></td></tr>
</table>
</td>
</logic:iterate>
##############################
When i try to save the page i get this exception:
10:26:53,258 ERROR [[action]] Servlet.service() for
servlet action threw exception
java.lang.NullPointerException
at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:515)
at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)
at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:770)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
Thanks in advance.
Regards,
Mike M.