From: <[EMAIL PROTECTED]>
> I need to access only the first object in this Array. Any ideas?
> I have a DTO that may contain a Guarantor[].
> Here is my code that keeps giving me an "null
java.lang.ArrayIndexOutOfBoundsException"
> when I do not have a Guarantor[0]
> <logic:notEmpty name="creditApplicationDto" property="guarantors">

You're checking to see if the array is null, not whether the first position
is.  I use Struts-EL and JSTL, so I don't know that I'll be much help with
syntax!  try property="guarantors[0]" but somehow I don't think that will
work.

How about a <c:set> (<bean:define>??) to grab the first item out of the
array and then use that in the other tags, to get rid of the array
subscript?

What about changing your DTO to have a "firstGuarantor" property, since
that's the only one you need?

-- 
Wendy Smoak


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

Reply via email to