pushtag.java

来自「webwork source」· Java 代码 · 共 45 行

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

import javax.servlet.jsp.JspException;

/**
 * Find the specified value using the ValueStack and then
 * push it on top of the stack. The stack is popped when
 * the end of the tag is reached.
 *
 * @author Dick Zetterberg (dick@transitor.se)
 * @version $Revision: 1.1 $
 */
public class PushTag extends WebWorkTagSupport
{
   // Attributes ----------------------------------------------------
   protected String valueAttr;

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

   public int doStartTag() throws JspException
   {
   	// Find the value and push it onto the stack
      Object value = findValue(valueAttr);
      getStack().pushValue(value);
      return EVAL_BODY_INCLUDE;
   }

   public int doEndTag() throws JspException
   {
   	// Pop the value from the stack
      getStack().popValue();
      return EVAL_PAGE;
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?