/*
 * WebWork, Web Application Framework
 *
 * Distributable under Apache license.
 * See terms of license at opensource.org
 */
package webwork.view.taglib;

import webwork.util.TextUtil;
import webwork.util.BeanUtil;

import javax.servlet.ServletException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.PageContext;
import java.util.Iterator;

/**
 *  Access the value of a named property. By default (implicitly),
 *  this tag will escape its contents if it does *not* have a body.
 *  If it does have a body, the tag will not escape the contents.
 *  You can explicitly tell the tag to escape or not.
 *  Quoted text that is escaped will have its quotes stripped off.
 *
 * @author Rickard Öberg (rickard@dreambean.com)
 * @author Matt Baldree (matt@smallleap.com)
 * @version $Revision: 1.1 $
 */
public class PushTag extends webwork.view.taglib.WebWorkTagSupport
{
   // Attributes ----------------------------------------------------
   protected String valueAttr;

   // Public --------------------------------------------------------
   public void setValue(String inName)
   {
      valueAttr = inName;
   }

   // BodyTag implementation ----------------------------------------
   public int doStartTag() throws JspException
   {
      Object value = findValue(valueAttr);
      getStack().pushValue(value);

      return SKIP_BODY;
   }

   public int doEndTag() throws JspException
   {
      return EVAL_PAGE;
   }
}