If you don't understand how the code works, there's no better solution
than running the application in your debugger and stepping through the
Struts and Commons source code.  When you get to the line that throws
the NPE, you'll have the first clue about what's going wrong.  You'll
need to make sure you have the source distributions corresponding to the
binary versions that you're using.  It's easy enough to know that you'll
need the source distribution for Struts 1.2.4, but it might not be
obvious that you'll need the source for Commons BeanUtils, version
1.6.1.  This is from the install guide.

Barring that, it would have helped if you'd included the actual
exception stack trace.  Someone could then look at the actual line to
get a clue about what's happening (although running in the debugger is
still better).

That being said, the most likely answer is that your "fields" list is
null, or too short.

> -----Original Message-----
> From: Oleg [mailto:[EMAIL PROTECTED] 
> 
> I finally got it to display, no problem, however there is an 
> error when I submit:
> 
> java.lang.NullPointerException
>        org.apache.commons.beanutils.PropertyUtils.getIndexedProperty
> 
> Here is what I got so far.
> Struts Version 1.2.4.
>  
> My FormActionForm includes an ArrayList fields of Bean Field.
> 
> FormActionForm:
> 
>     public ArrayList getFields() {
>       return fields;
>     }
> 
>   public void setFields(ArrayList fields) {
>     this.fields = fields;
>   }
> ....................................................
> 
> Field
> 
>   private String label;
>   private String name;
>   private String value;
>   private String type;
> ... with all getters and setters .......... 
> ..............................................................
> .........................
> JSP (displays no problem!!):
>  <logic-el:iterate name="formActionForm" property="fields" 
> id="foo" indexId="ctr">
>   <tr>
>   <td><html-el:text property='<%= "fields[" + ctr + "].label" 
> %>' /></td>
>   <td><html-el:text property='<%= "fields[" + ctr + "].value" 
> %>' /></td>
>   <td><html-el:checkbox property='<%= "fields[" + ctr + 
> "].required" %>' /></td>
>   </tr>
> </logic-el:iterate>
> 
> 
> Hit the wall here, big time.
> 
> Thanks,
> Oleg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to