⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 textarea.java

📁 这是一个mvc模式
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package jsp.tags.dapact.tags.html;

import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import jsp.tags.dapact.BaseDataTagSupport;
import jsp.tags.dapact.util.TagUtil;
/**
 * Title:        Data Aware Processing And Control Tags
 * Description:  Tag library for the processing and controlling the input and output of data.
 * Copyright:    LGPL (http://www.gnu.org/copyleft/lesser.html)
 * Compile Date: @compile_date@
 * @author Allen M Servedio
 * @amp_sign@version @VERSION@
 */

/**
 * Implements a data aware HTML <textarea> tag.
 */
public class Textarea extends BaseDataTagSupport
{
  /**
   * Default constructor...
   */
  public Textarea()
  {
  }

  /**
   * Called when the starting tag is found - writes the start tag and its attributes.
   *
   * @return EVAL_BODY_INCLUDE so that it processes what ever is in the body.
   */
  public int doStartTag() throws JspException
  {
    // The super class will lookup and set the new value in the new value property.
    super.doStartTag();

    String valAsStr = TagUtil.getStringFromObj(getNewValue());
    if (valAsStr != null)
    {
      setValue(valAsStr);
    }
    String newVal = getValue();

    try
    {
      JspWriter out = pageContext.getOut();
      out.write("<textarea");
      out.write(TagUtil.getAllAttrAsStr(getValues(), this));
      out.write(">");
      if (newVal != null)
      {
        out.write(newVal);
      }
    }
    catch (IOException e)
    {
      throw new JspException("JspWriter not there: " + e);
    }
    return EVAL_BODY_INCLUDE;
  }

  /**
   * Called at the end of the tag. Will output the end body tag text and return that
   * it wants to have the rest of the page processed.
   *
   * @exception JspException general JSP exception.
   *
   * @return EVAL_PAGE so that it continues to process the rest of the page.
   */
  public int doEndTag() throws JspException
  {
    super.doEndTag();
    try
    {
      JspWriter out = pageContext.getOut();
      out.write("</textarea>");
    }
    catch (IOException e)
    {
      throw new JspException("JspWriter not there: " + e);
    }
    return EVAL_PAGE;
  }

  /*=============================================================================*/
  /*                           PROPERTIES/ATTRIBUTES                             */
  /*=============================================================================*/
  /**
   * Constant that specifies the value of the name of the accesskey property.
   */
  public static final String ACCESSKEY_PROP = "accesskey";
  /**
   * Get the value of the accesskey property.
   *
   * @return the value of the accesskey property.
   */
  public String getAccesskey()
  {
    return (String)getValue(ACCESSKEY_PROP);
  }
  /**
   * Set the value of the accesskey property.
   *
   * @param value the value of the accesskey property.
   */
  public void setAccesskey(String value)
  {
    setValue(ACCESSKEY_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the _class property.
   */
  public static final String _CLASS_PROP = "class";
  /**
   * Get the value of the _class property.
   *
   * @return the value of the _class property.
   */
  public String get_class()
  {
    return (String)getValue(_CLASS_PROP);
  }
  /**
   * Set the value of the _class property.
   *
   * @param value the value of the _class property.
   */
  public void set_class(String value)
  {
    setValue(_CLASS_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the cols property.
   */
  public static final String COLS_PROP = "cols";
  /**
   * Get the value of the cols property.
   *
   * @return the value of the cols property.
   */
  public String getCols()
  {
    return (String)getValue(COLS_PROP);
  }
  /**
   * Set the value of the cols property.
   *
   * @param value the value of the cols property.
   */
  public void setCols(String value)
  {
    setValue(COLS_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the dir property.
   */
  public static final String DIR_PROP = "dir";
  /**
   * Get the value of the dir property.
   *
   * @return the value of the dir property.
   */
  public String getDir()
  {
    return (String)getValue(DIR_PROP);
  }
  /**
   * Set the value of the dir property.
   *
   * @param value the value of the dir property.
   */
  public void setDir(String value)
  {
    setValue(DIR_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the disabled property.
   */
  public static final String DISABLED_PROP = "disabled";
  /**
   * Get the value of the disabled property.
   *
   * @return the value of the disabled property.
   */
  public String getDisabled()
  {
    return (String)getValue(DISABLED_PROP);
  }
  /**
   * Set the value of the disabled property.
   *
   * @param value the value of the disabled property.
   */
  public void setDisabled(String value)
  {
    setValue(DISABLED_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the id property.
   */
  public static final String ID_PROP = "id";
  /**
   * Get the value of the id property.
   *
   * @return the value of the id property.
   */
  public String getId()
  {
    return (String)getValue(ID_PROP);
  }
  /**
   * Set the value of the id property.
   *
   * @param value the value of the id property.
   */
  public void setId(String value)
  {
    super.setId(value);
    setValue(ID_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the lang property.
   */
  public static final String LANG_PROP = "lang";
  /**
   * Get the value of the lang property.
   *
   * @return the value of the lang property.
   */
  public String getLang()
  {
    return (String)getValue(LANG_PROP);
  }
  /**
   * Set the value of the lang property.
   *
   * @param value the value of the lang property.
   */
  public void setLang(String value)
  {
    setValue(LANG_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the onblur property.
   */
  public static final String ONBLUR_PROP = "onblur";
  /**
   * Get the value of the onblur property.
   *
   * @return the value of the onblur property.
   */
  public String getOnblur()
  {
    return (String)getValue(ONBLUR_PROP);
  }
  /**
   * Set the value of the onblur property.
   *
   * @param value the value of the onblur property.
   */
  public void setOnblur(String value)
  {
    setValue(ONBLUR_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the onchange property.
   */
  public static final String ONCHANGE_PROP = "onchange";
  /**
   * Get the value of the onchange property.
   *
   * @return the value of the onchange property.
   */
  public String getOnchange()
  {
    return (String)getValue(ONCHANGE_PROP);
  }
  /**
   * Set the value of the onchange property.
   *
   * @param value the value of the onchange property.
   */
  public void setOnchange(String value)
  {
    setValue(ONCHANGE_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the onclick property.
   */
  public static final String ONCLICK_PROP = "onclick";
  /**
   * Get the value of the onclick property.
   *
   * @return the value of the onclick property.
   */
  public String getOnclick()
  {
    return (String)getValue(ONCLICK_PROP);
  }
  /**
   * Set the value of the onclick property.
   *
   * @param value the value of the onclick property.
   */
  public void setOnclick(String value)
  {
    setValue(ONCLICK_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the ondblclick property.
   */
  public static final String ONDBLCLICK_PROP = "ondblclick";
  /**
   * Get the value of the ondblclick property.
   *
   * @return the value of the ondblclick property.
   */
  public String getOndblclick()
  {
    return (String)getValue(ONDBLCLICK_PROP);
  }
  /**
   * Set the value of the ondblclick property.
   *
   * @param value the value of the ondblclick property.
   */
  public void setOndblclick(String value)
  {
    setValue(ONDBLCLICK_PROP, value);
  }

  /**
   * Constant that specifies the value of the name of the onfocus property.
   */
  public static final String ONFOCUS_PROP = "onfocus";
  /**
   * Get the value of the onfocus property.
   *
   * @return the value of the onfocus property.
   */
  public String getOnfocus()
  {
    return (String)getValue(ONFOCUS_PROP);
  }
  /**
   * Set the value of the onfocus property.
   *
   * @param value the value of the onfocus property.
   */
  public void setOnfocus(String value)
  {
    setValue(ONFOCUS_PROP, value);
  }

⌨️ 快捷键说明

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