Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean:write datetime

 
ameya n
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i show date time on a jsp....using bean:write what do i keep the format ?............ my java bean data type is java.sql.Date from database am getting as getDate("Date") ......am just able to show date and not time.....i want both
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bean:write tag can take a format parameter which will probably do what you need. The technique that I use is to either format the date when populating the form using a utility method or to call the utility method from some scriptlet code in the JSP. I have thought about creating a custom tag to avoid the scriptlet code, but I have not gotten around to that.

- Brent
 
ameya n
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks brent ..........TimeStamp solved the problem .......... i now TimeStamp
instead of Date
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic