public class VelocityViewTag
extends BodyTagSupport
This tag enables use of Velocity and VelocityTools within JSP files and tags.
This makes it trivial to render embedded VTL (Velocity Template Language)
or include a separate Velocity template within a JSP using the current
page context. This also automatically provides the typical
VelocityView
toolbox support, much like the VelocityViewServlet
and VelocityLayoutServlets have. In fact, this will by default share
the VelocityView
instance used with those servlets. This allows
for consistent configuration and shared resources (better performance).
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
bodyContentKey |
private boolean |
cache |
protected ViewToolContext |
context |
static java.lang.String |
DEFAULT_BODY_CONTENT_KEY |
protected StringResourceRepository |
repository |
protected java.lang.String |
scope |
private static long |
serialVersionUID |
protected java.lang.String |
template |
protected java.lang.String |
var |
protected VelocityView |
view |
Constructor and Description |
---|
VelocityViewTag() |
Modifier and Type | Method and Description |
---|---|
protected void |
cache(java.lang.String name,
java.lang.String template) |
int |
doEndTag() |
int |
doStartTag() |
protected void |
evalBody(java.io.Writer out) |
java.lang.String |
getBodyContentKey() |
java.lang.String |
getCache() |
protected java.lang.String |
getLogId() |
protected java.lang.String |
getRenderedBody() |
StringResourceRepository |
getRepository() |
java.lang.String |
getScope() |
java.lang.String |
getTemplate() |
java.lang.String |
getVar() |
VelocityView |
getVelocityView() |
ViewToolContext |
getViewToolContext() |
protected boolean |
hasContent() |
protected void |
initializeView() |
protected boolean |
isCached() |
void |
release()
Release any per-instance resources, releasing any resources or state
before this tag instance is disposed.
|
protected void |
renderBody(java.io.Writer out) |
protected void |
renderContent(java.io.Writer out) |
protected void |
reset()
Release any per-invocation resources, resetting any resources or state
that should be cleared between successive invocations of
javax.servlet.jsp.tagext.Tag#doEndTag() and
javax.servlet.jsp.tagext.Tag#doStartTag() . |
void |
setBodyContentKey(java.lang.String key) |
void |
setCache(java.lang.String s) |
void |
setId(java.lang.String id) |
void |
setRepository(StringResourceRepository repo) |
void |
setScope(java.lang.String scope) |
void |
setTemplate(java.lang.String template) |
void |
setVar(java.lang.String var) |
void |
setVelocityView(VelocityView view) |
void |
setViewToolContext(ViewToolContext context) |
protected static int |
toScopeInt(java.lang.String scope) |
public static final java.lang.String DEFAULT_BODY_CONTENT_KEY
private static final long serialVersionUID
protected transient VelocityView view
protected transient ViewToolContext context
protected transient StringResourceRepository repository
protected java.lang.String var
protected java.lang.String scope
protected java.lang.String template
protected java.lang.String bodyContentKey
private boolean cache
protected void reset()
javax.servlet.jsp.tagext.Tag#doEndTag()
and
javax.servlet.jsp.tagext.Tag#doStartTag()
.public void setId(java.lang.String id)
protected java.lang.String getLogId()
public void setVar(java.lang.String var)
public java.lang.String getVar()
public void setScope(java.lang.String scope)
public java.lang.String getScope()
public void setTemplate(java.lang.String template)
public java.lang.String getTemplate()
public void setBodyContentKey(java.lang.String key)
public java.lang.String getBodyContentKey()
public void setCache(java.lang.String s)
public java.lang.String getCache()
public VelocityView getVelocityView()
public void setVelocityView(VelocityView view)
public ViewToolContext getViewToolContext()
public void setViewToolContext(ViewToolContext context)
public StringResourceRepository getRepository()
public void setRepository(StringResourceRepository repo)
public int doStartTag() throws JspException
JspException
public int doEndTag() throws JspException
JspException
protected void initializeView()
protected boolean hasContent()
protected void renderContent(java.io.Writer out) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getRenderedBody() throws java.lang.Exception
java.lang.Exception
protected boolean isCached()
protected void renderBody(java.io.Writer out) throws java.lang.Exception
java.lang.Exception
protected void evalBody(java.io.Writer out) throws java.lang.Exception
java.lang.Exception
protected static int toScopeInt(java.lang.String scope)
protected void cache(java.lang.String name, java.lang.String template)
public void release()
javax.servlet.jsp.tagext.Tag#release()
Copyright (c) 2003-2007 Apache Software Foundation