1 12 package org.displaytag.sample; 13 14 import java.util.Date ; 15 16 import javax.servlet.jsp.PageContext ; 17 18 import org.apache.commons.lang.time.FastDateFormat; 19 import org.displaytag.decorator.DisplaytagColumnDecorator; 20 import org.displaytag.exception.DecoratorException; 21 import org.displaytag.properties.MediaTypeEnum; 22 23 24 30 public class LongDateWrapper implements DisplaytagColumnDecorator 31 { 32 33 36 private FastDateFormat dateFormat = FastDateFormat.getInstance("MM/dd/yyyy HH:mm:ss"); 38 42 public Object decorate(Object columnValue, PageContext pageContext, MediaTypeEnum media) throws DecoratorException 43 { 44 Date date = (Date ) columnValue; 45 return this.dateFormat.format(date); 46 } 47 } 48 | Popular Tags |