This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes bean:write datetime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:write datetime" Watch "bean:write datetime" New topic

bean:write datetime

ameya n

Joined: May 14, 2007
Posts: 17
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") just able to show date and not time.....i want both
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
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

Joined: May 14, 2007
Posts: 17
thanks brent ..........TimeStamp solved the problem .......... i now TimeStamp
instead of Date
Consider Paul's rocket mass heater.
subject: bean:write datetime
jQuery in Action, 3rd edition