----- Original Message ----- From: "Larsson, Jonas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 18, 2004 11:41 AM Subject: [OS-webwork] Rendering java.sql.Timestamp?
> > Can someone please give me a pointer to how to customize the formatter for > rendering date objects (and it's subclasses). I am trying to render a > java.sql.Timestamp property and it only shows the date (not the time) AND > the date is on the wrong locale. > > I remember seeing something about this somewhere, but I can't find it again. > > I'm using WW1.4 and the WW taglib BTW. > > Regards > > Jonas > You can create your own property editor and register it with the PropertyEditorManager instead of the ones that Webwork registers by default. Do this during application initialisation before the editor has been used, for example: // Make sure to load BeanUtil and have Webwork register its editors BeanUtil loadClass = new BeanUtil(); // Register your own timestamp editor PropertyEditorManager.registerEditor(Timestamp.class, MyTimestampEditor.class); PropertyEditorManager.registerEditor(Timestamp[].class, MyTimestampEditor.class); // Register your own date editor PropertyEditorManager.registerEditor(Date.class, MyDateEditor.class); PropertyEditorManager.registerEditor(Date[].class, MyDateEditor.class); They will now be used when you output or input those kinds of objects. As an example of an editor look at webwork's in the webwork.util.editor package. For best performance make sure to implement the webwork.util.editor.FastPropertyEditor interface. Best regards, Dick Zetterberg ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork