Struts - Nested or Indexed Array not working - Invalid argument looking up property of bean

Posted on 2007-07-30
Last Modified: 2008-01-09
I have an array of a class in my bean and when I try loading the JSP, it throws me the error given below.

javax.servlet.jsp.JspException: Invalid argument looking up property emailTO[0].internetIdentifier of bean org.apache.struts.taglib.html.BEAN
      at org.apache.struts.taglib.TagUtils.lookup(
      at org.apache.struts.taglib.html.BaseFieldTag.prepareValue(
      at org.apache.struts.taglib.html.BaseFieldTag.renderInputElement(
      at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(

public class FieldIntellFormBean extends BaseFormBean {

      private InternetIdentifierTO[] emailTO = new InternetIdentifierTO[3];

      private InternetIdentifierTO[] imNameTO = new InternetIdentifierTO[3];

      public FieldIntellFormBean() {

            for (int j = 0; j < SIZE; j++) {
                  emailTO[j] = new InternetIdentifierTO();

                  imNameTO[j] = new InternetIdentifierTO();

public class InternetIdentifier{

      private String internetIdentifier;


public InternetIdentifierTO(){
      internetIdentifier = "";

Any Help?

Question by:kanishkpanwar

    Author Comment

    This is how I access the object attribues

    <html:text property="emailTO[0].internetIdentifier" styleClass="standardText" maxlength="98" size="21" />
    LVL 14

    Expert Comment

    If you have nested bean, you should use nested tag instead.
        <nested:text property="emailTO[0].internetIdentifier"/>

    Or you can use iterator to loop the array:
        <nested:iterate name="theFormName" property="emailTO">
            <nested:text property="internetIdentifier"/>

    Boon Leng

    Author Comment

    nevermind. I figured it out myself.

    I had to put this in my reset method of the bean.

      for (int j = 0; j < SIZE; j++) {
                      emailTO[j] = new InternetIdentifierTO();

                      imNameTO[j] = new InternetIdentifierTO();

    Admins: - Can I have a refund for my points?
    LVL 26

    Expert Comment

    No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

    I will leave the following recommendation for this question in the Cleanup Zone:
    PAQ - Refund

    Any objections should be posted here in the next 4 days. After that time, the question will be closed.

    mrcoffee365 Experts Exchange Cleanup Volunteer
    LVL 1

    Accepted Solution

    PAQed with points refunded (500)

    EE Admin

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Spring Tuorial 1 105
    loop through list of objects 14 178
    Fisheye tool 2 97
    using if condition without JSTL 2 99
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Read about the 3 stages of the buyer's journey: awareness, consideration, and decision.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now