org.apache.taglibs.velocity
Class VelocityTag

java.lang.Object
  extended by org.apache.taglibs.velocity.VelocityTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class VelocityTag
extends java.lang.Object
implements javax.servlet.jsp.tagext.BodyTag

Simple implementation of JSP tag to allow use of VTL in JSP's.

Version:
$Id: VelocityTag.java 517121 2007-03-12 07:45:49Z ate $
Author:
Geir Magnusson Jr.

Field Summary
protected  javax.servlet.jsp.tagext.BodyContent bodyContent
           
protected  javax.servlet.jsp.PageContext pageContext
           
protected  javax.servlet.jsp.tagext.Tag parent
           
protected  boolean strictAccess
           
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
VelocityTag()
          CTOR : current implementation uses the Singleton model for velocity.
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
          This is the real worker for this taglib.
 void doInitBody()
           
 int doStartTag()
           
 javax.servlet.jsp.tagext.Tag getParent()
           
 void release()
           
 void setBodyContent(javax.servlet.jsp.tagext.BodyContent bc)
           
 void setPageContext(javax.servlet.jsp.PageContext pc)
           
 void setParent(javax.servlet.jsp.tagext.Tag parent)
           
 void setStrictaccess(boolean sa)
          switch for strictaccess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected javax.servlet.jsp.tagext.Tag parent

bodyContent

protected javax.servlet.jsp.tagext.BodyContent bodyContent

pageContext

protected javax.servlet.jsp.PageContext pageContext

strictAccess

protected boolean strictAccess
Constructor Detail

VelocityTag

public VelocityTag()
CTOR : current implementation uses the Singleton model for velocity.

Method Detail

setStrictaccess

public void setStrictaccess(boolean sa)
switch for strictaccess

Parameters:
sa - if true, then normal VelocityContext is used and template must directly get beans from scopes Otherwise, the JSPContext is used which searches for objects/beans in the scopes automatically.

getParent

public javax.servlet.jsp.tagext.Tag getParent()
Specified by:
getParent in interface javax.servlet.jsp.tagext.Tag

setParent

public void setParent(javax.servlet.jsp.tagext.Tag parent)
Specified by:
setParent in interface javax.servlet.jsp.tagext.Tag

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspException

setBodyContent

public void setBodyContent(javax.servlet.jsp.tagext.BodyContent bc)
Specified by:
setBodyContent in interface javax.servlet.jsp.tagext.BodyTag

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pc)
Specified by:
setPageContext in interface javax.servlet.jsp.tagext.Tag

doInitBody

public void doInitBody()
                throws javax.servlet.jsp.JspException
Specified by:
doInitBody in interface javax.servlet.jsp.tagext.BodyTag
Throws:
javax.servlet.jsp.JspException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Throws:
javax.servlet.jsp.JspException

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
This is the real worker for this taglib. There are efficiencies to be added - the plan is to cache the AST to avoid reparsing every time.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspException


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.