This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JSF and the fly likes Format a date represented as a String to another String representation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Format a date represented as a String to another String representation" Watch "Format a date represented as a String to another String representation" New topic
Author

Format a date represented as a String to another String representation

Fredrik Larsback
Greenhorn

Joined: Dec 21, 2009
Posts: 9
How do I format a date string to a string with another format with JSF?

E.g.
Format "20100224091007.000000Z" to "2010-02-24 09:10:07"

Regards
/Fredrik
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17151
    
  27

What are you expecting JSF to do? Your example is just free-floating data without any context. You're describing a process that can be done without JSF or even any web application at all.


An IDE is no substitute for an Intelligent Developer.
Fredrik Larsback
Greenhorn

Joined: Dec 21, 2009
Posts: 9
Tim Holloway wrote:What are you expecting JSF to do? Your example is just free-floating data without any context. You're describing a process that can be done without JSF or even any web application at all.


I have a Seam application which reads a date as a string from a backing bean which is packaged in a jar which can't be modified. I'd like to know if there is way to format this date-String to another format in my .xhtml page through some tag library like <f:convertDateTime> or should a write my own facelet tag library to achive this?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17151
    
  27

I believe that's within the capabilities of the JSF Converter architecture. A Converter basically has 2 methods in it (inbound and outbound conversions), and is typically registered in the faces-config file, where you bind the actual converter class to a logical converter name for use in converter tags.
Fredrik Larsback
Greenhorn

Joined: Dec 21, 2009
Posts: 9
Tim Holloway wrote:I believe that's within the capabilities of the JSF Converter architecture. A Converter basically has 2 methods in it (inbound and outbound conversions), and is typically registered in the faces-config file, where you bind the actual converter class to a logical converter name for use in converter tags.


Ok, thanks. Then I'll write a converter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Format a date represented as a String to another String representation
 
It's not a secret anymore!