aspose file tools*
The moose likes Struts and the fly likes Date inside iterator 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 "Date inside iterator" Watch "Date inside iterator" New topic
Author

Date inside iterator

Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
Can someone lead me to a good struts 2 iterator tutorial.
I want to show a date (basically use <s:date>) inside an iterator.


SCJP 6
How To Ask Questions On Java Ranch - How To Answer Questions On Java Ranch
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Did you look at the iterator tag reference??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
Yes Ankit, I started from that
and I am able to see my date in long using this:


But I want to see it in the date format, something like this:


which comes as empty
Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
Has no one ever got a requirement like this
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Is the startTime property a Date object or something else. You said that when you use s:property to print the date, you get it in long format, but the toString method of Date class doesn't print a long value. Its not clearly given in the documentation of s:date tag whether it accepts only date objects or not (I've never used s:date so I can't say anything for sure)...
Sachin Adat
Ranch Hand

Joined: Sep 03, 2007
Posts: 213
Wow, nice catch Ankit, the place where I was using s:date without an iterator was a date and it was working fine.
And, inside the iterator I m getting a long, so it would not show the date.

Thanks a lot, I think I can fix it now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date inside iterator
 
Similar Threads
LinkedList and ConcurrentModification Exception problem
I can't build???
How to merge 2 hashsets into 1 hashset?
Problem using bean:define
Dispalying random dates