Ok, you asked for it! :-)

This is kind of circular, so I have to pick some place to start.

I will start by showing how the vectors are created, and then move
towards the jsp...  All comments removed to save space.

While looking at the code snippets, look at the "LOOK HERE - # !!!"
(there are two).  If setWireData is called in the adapter and
property="wireData" is used in the jsp, it fails with the no getter
error.  If either of them use the Xyzzy getter it works.

The same thing occurs if I don't use the nested iterate and just do a
bean:write.

I hope this makes sense!  Thanks!

/greg

==============================================================================
My action (BfPerformSearch.java):

    BfSearchAdapter bfsa = new BfSearchAdapter(ad, bfsc);

    request.setAttribute("bfData", bfsa.getbfData());

==============================================================================
My adapter (BfSearchAdapter.java):

    BankFullEntryData[] bed = SomeFunction();
            
    bflist = new Vector();

    for(int i = 0; i < bed.length; i++) {
        BfFullEntryData bffed = new BfFullEntryData();
            bffed.setName(bed[i].NameAndAddress);

LOOK HERE - #1 !!!

            bffed.setWireData(bed[i].WireInfo);

            bflist.add(bffed);
        }
    }

==============================================================================
My DTO (BfFullEntryData.java):

    public class BfFullEntryData
    {
        BfEntryData  nameAndAddress = null;
        Vector       wireInfo       = null;
        BfEntryData  advBank        = null;
    
        public BfEntryData getName() {
            return(nameAndAddress);
        }
    
        public void setName(BankEntryData _nameAndAddress) {
            nameAndAddress = new BfEntryData();
    
            nameAndAddress.setAllFields(_nameAndAddress);
        }
    
        public Vector getXyzzy() {
            return(getWireData());
        }
        
        public void setXyzzy(WireData[] _wireInfo) {
            setWireData(_wireInfo);
        }
        
        public Vector getWireData() {
            return(wireInfo);
        }
    
        public void setWireData(WireData[] _wireInfo) {
            wireInfo = new Vector();
    
            for(int i = 0; i < _wireInfo.length; i++) {
                BfWireData wd = new BfWireData();

                wd.setAllFields(_wireInfo[i]);
                wireInfo.add(wd);
            }
        }
    ...

==============================================================================
My jsp (results.jsp):

<html:form action="BfPerformSearchAction">

<table bgcolor="white" border=0 cellpadding=5 cellspacing=0>
  <tr>
    <td align="center" bgcolor="#0000ff">
      <font face="verdana" color="#ffffff" size="-2">
        <bean:message key="crp.bf.list.number"/>
      </font>
    </td>
              
    <td align="center" bgcolor="#0000ff">
      <font face="verdana" color="#ffffff" size="-2">
        <bean:message key="crp.bf.list.name"/>
      </font>
    </td>
              
    <td align="center" bgcolor="#0000ff">
      <font face="verdana" color="#ffffff" size="-2">
        <bean:message key="crp.bf.list.address1"/>
      </font>
    </td>
              
    <td align="center" bgcolor="#0000ff">
      <font face="verdana" color="#ffffff" size="-2">
        <bean:message key="crp.bf.list.city"/>
      </font>
    </td>
              
    <td align="center" bgcolor="#0000ff">
      <font face="verdana" color="#ffffff" size="-2">
        <bean:message key="crp.bf.list.shortname"/>
      </font>
    </td>
              
  </tr>

  <logic:iterate id="item" name="bfData"
                 type="com.bankofny.inx.omx.lc.web.dto.BfFullEntryData"
                 indexId="index">
                
      <tr bgcolor="#ffffff">

      <td>
        <font face="verdana" size="-2">
          <bean:write name="index"/>
        </font>
      </td>
              
      <td>
        <font face="verdana" size="-2">
          <bean:write name="item" property="name.name"/>
        </font>
      </td>
              
      <td>
        <font face="verdana" size="-2">
          <bean:write name="item" property="name.address1"/>
        </font>
      </td>
              
      <td>
        <font face="verdana" size="-2">
          <bean:write name="item" property="name.city"/>
        </font>
      </td>
              
      <td>
        <font face="verdana" size="-2">
          <bean:write name="item" property="name.shortName"/>
        </font>
      </td>
              
    </tr>

LOOK HERE - #2 !!!

    <logic:iterate id="obj" name="item" property="wireData"
                   type="com.bankofny.inx.omx.lc.web.dto.BfWireData">

      <tr bgcolor="#ffffee">

      <td>
        <font face="verdana" size="-2">
          &nbsp;
        </font>
      </td>
      <td>
        <font face="verdana" size="-2">
          <bean:write name="obj" property="wireCode"/>
        </font>
      </td>
      <td>
        <font face="verdana" size="-2">
          &nbsp;
        </font>
      </td>
      <td>
        <font face="verdana" size="-2">
          &nbsp;
        </font>
      </td>
    </tr>
                    
    </logic:iterate>
  </logic:iterate>

</table>

<html:submit property="action">
  <bean:message key="crp.bf.search.search"/>
</html:submit>

</html:form>

==============================================================================

On Sep 11, 2003, Erez Efrati <[EMAIL PROTECTED]>  wrote:

 |Some code snippets would shed some light here... :)
 |
 |Regards,
 |Erez
 |
 |-----Original Message-----
 |From: Gregory F. March [mailto:[EMAIL PROTECTED] 
 |Sent: Thursday, September 11, 2003 6:07 PM
 |To: [EMAIL PROTECTED]
 |Subject: jsp -> java naming issue
 |
 |
 |Back to coding...  I've been struggling with an issue for the past two
 |days that I just cannot solve.  There is a bunch of stuff going on, but
 |I believe I have narrowed it down to the following.
 |
 |Here are the cast of characters:
 |
 |Vector v1 of data that contains an element that is another Vector v2.
 |A jsp that iterates through both vectors
 |Class c1 that contains the data for v1 with appropriate getters and
 |setters
 |Class c2 that contains the data for v2 with appropriate getters and
 |setters
 |An adapter that populates the Vector v1 and v2 using the above two
 |classes
 |
 |What happens:
 |
 |jsp does a logic:iterate id=item name=v1
 |jsp does a bean:write name=item property=v2
 |
 |I get a servlet exception saying there is no getter method for property
 |v1 of bean item.
 |
 |Here is where it gets weird.  It is convoluted, so bear with me...
 |
 |If I create a dummy getter (getXyzzy) and setter (setXyzzy) in c1 that
 |simply call the original getters and setters (getV2, setV2), and have
 |the jsp do a bean:write name=item property=xyzzy, it works (no
 |exception).
 |
 |If I leave the jsp alone (bean:write name=item property=v2), but change
 |the adapter to call setXyzzy instead of setV2, it works too!
 |
 |In other words, the following table occurs:
 |
 |jsp             adapter         works
 |-------------------------------------
 |property=v2     setV2           No
 |property=xyzzy  setV2           Yes
 |property=v2     setXyzzy        Yes
 |
 |I am totally stumped as to why this is occurring.  Now, keep in mind
 |that other bean:write's on item are working fine.
 |
 |Any help would be really, really appreciated.  I've had two other people
 |look at it and they are stumped too.
 |
 |If I didn't make myself clear, let me know and I'll try my best to
 |explain it better.
 |
 |Thanks...
 |
 |/greg
 |
 |--
 |Gregory F. March    -=-    http://www.gfm.net:81/~march    -=-
 |AIM:GfmNet
 |
 |---------------------------------------------------------------------
 |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]

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

Reply via email to