org.apache.velocity.tools.view.jsp
Class VelocityViewTag
java.lang.Object
BodyTagSupport
org.apache.velocity.tools.view.jsp.VelocityViewTag
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).
- Since:
- VelocityTools 2.0
- Version:
- $Id: VelocityViewTag.java,v 1.1 2001/08/14 00:07:39 geirm Exp $
- Author:
- Nathan Bubna
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_BODY_CONTENT_KEY
public static final java.lang.String DEFAULT_BODY_CONTENT_KEY
- See Also:
- Constant Field Values
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
view
protected transient VelocityView view
context
protected transient ViewToolContext context
repository
protected transient StringResourceRepository repository
var
protected java.lang.String var
scope
protected java.lang.String scope
template
protected java.lang.String template
bodyContentKey
protected java.lang.String bodyContentKey
cache
private boolean cache
VelocityViewTag
public VelocityViewTag()
reset
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()
.
setId
public void setId(java.lang.String id)
getLogId
protected java.lang.String getLogId()
setVar
public void setVar(java.lang.String var)
getVar
public java.lang.String getVar()
setScope
public void setScope(java.lang.String scope)
getScope
public java.lang.String getScope()
setTemplate
public void setTemplate(java.lang.String template)
getTemplate
public java.lang.String getTemplate()
setBodyContentKey
public void setBodyContentKey(java.lang.String key)
getBodyContentKey
public java.lang.String getBodyContentKey()
setCache
public void setCache(java.lang.String s)
getCache
public java.lang.String getCache()
getVelocityView
public VelocityView getVelocityView()
setVelocityView
public void setVelocityView(VelocityView view)
getViewToolContext
public ViewToolContext getViewToolContext()
setViewToolContext
public void setViewToolContext(ViewToolContext context)
getRepository
public StringResourceRepository getRepository()
setRepository
public void setRepository(StringResourceRepository repo)
doStartTag
public int doStartTag()
throws JspException
- Throws:
JspException
doEndTag
public int doEndTag()
throws JspException
- Throws:
JspException
initializeView
protected void initializeView()
hasContent
protected boolean hasContent()
renderContent
protected void renderContent(java.io.Writer out)
throws java.lang.Exception
- Throws:
java.lang.Exception
getRenderedBody
protected java.lang.String getRenderedBody()
throws java.lang.Exception
- Throws:
java.lang.Exception
isCached
protected boolean isCached()
renderBody
protected void renderBody(java.io.Writer out)
throws java.lang.Exception
- Throws:
java.lang.Exception
evalBody
protected void evalBody(java.io.Writer out)
throws java.lang.Exception
- Throws:
java.lang.Exception
toScopeInt
protected static int toScopeInt(java.lang.String scope)
cache
protected void cache(java.lang.String name,
java.lang.String template)
release
public void release()
- Release any per-instance resources, releasing any resources or state
before this tag instance is disposed.
- See Also:
javax.servlet.jsp.tagext.Tag#release()
Copyright (c) 2003-2007 Apache Software Foundation