View using Velocity template engine.
Based on code in the VelocityServlet shipped with Velocity.
Exposes the following JavaBean properties:
exposeCurrencyFormatter: whether to expose a CurrencyFormatter helper object.
- Author:
- Rod Johnson
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATE_FORMAT_KEY
public static final java.lang.String DATE_FORMAT_KEY
- Helper context name
CURRENCY_FORMAT_KEY
public static final java.lang.String CURRENCY_FORMAT_KEY
- Helper context name
DEFAULT_OUTPUT_ENCODING
public static final java.lang.String DEFAULT_OUTPUT_ENCODING
- Encoding for the output stream
VelocityView
public VelocityView()
- Creates new VelocityView
setPoolSize
public void setPoolSize(int sz)
getPoolSize
public int getPoolSize()
getCache
public boolean getCache()
setCache
public void setCache(boolean cache)
getExposeDateFormatter
public boolean getExposeDateFormatter()
- Gets the exposeDateFormatter.
- Returns:
- Returns a boolean
setExposeDateFormatter
public void setExposeDateFormatter(boolean exposeDateFormatter)
- Sets the exposeDateFormatter.
- Parameters:
exposeDateFormatter - The exposeDateFormatter to set
getExposeCurrencyFormatter
public boolean getExposeCurrencyFormatter()
- Gets the exposeCurrencyFormatter.
- Returns:
- Returns a boolean
setExposeCurrencyFormatter
public void setExposeCurrencyFormatter(boolean exposeCurrencyFormatter)
- Sets the exposeCurrencyFormatter.
- Parameters:
exposeCurrencyFormatter - The exposeCurrencyFormatter to set
setTemplateName
public void setTemplateName(java.lang.String templateName)
throws javax.servlet.ServletException
- Set the name of the wrapped Velocity template.
This will cause the template to be loaded.
- Parameters:
templateName - the name of the wrapped Velocity template,
relative to the Velocity template root. For example,
"/ic/interestResult.vm".
renderMergedOutputModel
protected void renderMergedOutputModel(java.util.Map model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException
- Render the view given the model to output.
- Overrides:
renderMergedOutputModel in class AbstractView
- Parameters:
model - combined output Map, with dynamic values
taking precedence over static attributesrequest - HttpServetRequestresponse - HttpServletResponse- Throws:
javax.servlet.ServletException - if there is any other error
Rod Johnson and Spring contributors 2001-2003.