File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
I agree. Here's the link:
subject: bean:write datetime
It's not a secret anymore!