net.sourceforge.xconf.toolbox.spring
Class SpringDateTool

java.lang.Object
  extended by org.apache.velocity.tools.generic.DateTool
      extended by net.sourceforge.xconf.toolbox.spring.SpringDateTool
All Implemented Interfaces:
org.apache.velocity.tools.view.tools.ViewTool

public class SpringDateTool
extends org.apache.velocity.tools.generic.DateTool
implements org.apache.velocity.tools.view.tools.ViewTool

Uses Spring's LocaleResolver and our TimeZoneResolver to resolve the Locale and TimeZone for each request.

This tool must be configured as a request scope tool in toolbox.xml.

Author:
Tom Czarniecki

Field Summary
 
Fields inherited from class org.apache.velocity.tools.generic.DateTool
DEFAULT_FORMAT
 
Constructor Summary
SpringDateTool()
           
 
Method Summary
 Locale getLocale()
           
 TimeZone getTimeZone()
           
 void init(Object ctx)
           
 
Methods inherited from class org.apache.velocity.tools.generic.DateTool
format, format, format, format, format, format, format, get, get, getCalendar, getDate, getDateFormat, getDateFormat, getDateFormat, getFormat, getFormattedDate, getStyleAsInt, getSystemCalendar, getSystemDate, toCalendar, toCalendar, toDate, toDate, toDate, toDate, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpringDateTool

public SpringDateTool()
Method Detail

init

public void init(Object ctx)
Specified by:
init in interface org.apache.velocity.tools.view.tools.ViewTool
See Also:
ViewTool.init(java.lang.Object)

getLocale

public Locale getLocale()
Overrides:
getLocale in class org.apache.velocity.tools.generic.DateTool
See Also:
RequestContextUtils.getLocale(javax.servlet.http.HttpServletRequest)

getTimeZone

public TimeZone getTimeZone()
Overrides:
getTimeZone in class org.apache.velocity.tools.generic.DateTool
See Also:
TimeZoneUtils.getTimeZone(HttpServletRequest)


Copyright © 2007 Thomas Czarniecki. All Rights Reserved.