aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "iterate through String [] issue" Watch "iterate through String [] issue" New topic
Author

iterate through String [] issue

Olga Lebedeva
Greenhorn

Joined: Jul 07, 2005
Posts: 1
Hi,

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 />
</logic:iterate>

Can you please advise?

Thanks.
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 ApplicationResources.properties 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 ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: iterate through String [] issue
 
Similar Threads
Iterating List With logic:iterate
bean:define not working in logic:iterate
Retrieving data using iterate and eliminating duplicate values
Struts Iterator Query
Iterate Hashmap through struts