Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date inside iterator

 
Sachin Adat
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone lead me to a good struts 2 iterator tutorial.
I want to show a date (basically use <s:date>) inside an iterator.
 
Ankit Garg
Sheriff
Posts: 9528
32
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look at the iterator tag reference??
 
Sachin Adat
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has no one ever got a requirement like this
 
Ankit Garg
Sheriff
Posts: 9528
32
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic