It's not a secret anymore!
The moose likes Struts and the fly likes iterate through String [] issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "iterate through String [] issue" Watch "iterate through String [] issue" New topic

iterate through String [] issue

Olga Lebedeva

Joined: Jul 07, 2005
Posts: 1

I have been struggling with this one for couple hours now and finally decided to get some help

I have a nested bean that has String [] of days and I need to iterate through that String [] to display days. At this point I get what looks like object's address: [Ljava.lang.String;@7e5c156

<logic:iterate id="myID" name="someForm" property="someForm.transports">
<bean:write name="myID" property="listDays"/><br />

Can you please advise?

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
For dates, the bean:write tag has to know how to format the date.

Add formatKey="date.format" to your <bean:write> tag. Then add date.format=MM/dd/yyyy to your file. Naturally the key can be anything you chose, and the format can be any valid date format that could be used by java.text.SimpleDateFormat.
[ July 07, 2005: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: iterate through String [] issue
jQuery in Action, 3rd edition