Please help me if I am doing anything wrong while trying to define my own
DynaActionForm.
1. Define MyDynaForm extends DynaActionForm
* define some methods that will be able to expose the
property names in this form bean.
like: getAllPropertyNames() that returns collection of
string property names.
* override the getDynaProperty method that can
return the DynaProperty object for the argument property
name.
2. In the jsp file,
By using the getAllPropertyNames, the jsp file should be
able to display all the property values.
With this approach, while MyDynaForm is instantiated first,
it is throwing NullPointerException as below:
java.lang.NullPointerException
at
org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.j
ava:1072)
at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j
ava:694)
at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:72
4)
at
org.apache.commons.beanutils.BeanUtils.getArrayProperty(BeanUtils.java:218)
at org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:293)
at org.apache.jsp.selectType$jsp._jspService(selectType$jsp.java:131)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet
I am not understanding this error. Please suggest me a way-out of this
problem.
Am I missing something here.
Thanks,
Mahesh