aspose file tools*
The moose likes Struts and the fly likes timestamp display problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "timestamp display problem" Watch "timestamp display problem" New topic
Author

timestamp display problem

arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
Hi on jsp using struts page I am displaying the timestamp

result-

Now rather than showing all values I wish to show only 07:20:16 means no date and no last 0 which is indiacating nanao seconds.

Now substring was option but the value returned is date here not string
Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
Use the formatkey property of Bean:Write

<bean:write property="test" name="testform" formatKey="formatkey"/>


Could be specified in the property file or directly specfied.

formatkey = "MM/dd/yyyy";
arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
solution


<td><bean:write name="detail" property="aTime" formatKey="org.apache.struts.taglib.bean.format.sql.timestamp" /></td>


and value in application properties like this

org.apache.struts.taglib.bean.format.sql.timestamp=hh:mm:ss

YA and after doing this restart your IDE
(use hh for 12 hour and HH FOR 24 HOUR)
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Arjun,

Please don't post the same question in multiple forums. It wastes the time of people responding to your question. This same question was posted by you in the JSP forum.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: timestamp display problem