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

📄 ajaxcallouttag.java

📁 The AJAX JSP Tag Library is a set of JSP tags that simplify the use of Asynchronous JavaScript and X
💻 JAVA
字号:
package org.ajaxtags.tags;

import java.io.IOException;
import java.text.MessageFormat;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager;

/**
 * Tag handler for the callout AJAX tag.
 * 
 * @author Darren Spurgeon
 * @version $Revision$ $Date$ $Author$
 */
public class AjaxCalloutTag extends TagSupport {

  private String anchorId;

  private String classNamePrefix;

  private String baseUrl;

  private String paramName;

  private String paramValue;

  private String boxPosition;

  private String title;

  private String useTitleBar;

  private String timeout;

  private String postFunc;

  private String emptyFunc;

  private String errorFunc;

  public String getAnchorId() {
    return anchorId;
  }

  public void setAnchorId(String anchorId) {
    this.anchorId = anchorId;
  }

  public String getBaseUrl() {
    return baseUrl;
  }

  public void setBaseUrl(String baseUrl) {
    this.baseUrl = baseUrl;
  }

  public String getBoxPosition() {
    return boxPosition;
  }

  public void setBoxPosition(String boxPosition) {
    this.boxPosition = boxPosition;
  }

  public String getClassNamePrefix() {
    return classNamePrefix;
  }

  public void setClassNamePrefix(String className) {
    this.classNamePrefix = className;
  }

  public String getEmptyFunc() {
    return emptyFunc;
  }

  public void setEmptyFunc(String emptyFunc) {
    this.emptyFunc = emptyFunc;
  }

  public String getErrorFunc() {
    return errorFunc;
  }

  public void setErrorFunc(String errorFunc) {
    this.errorFunc = errorFunc;
  }

  public String getParamName() {
    return paramName;
  }

  public void setParamName(String paramName) {
    this.paramName = paramName;
  }

  public String getParamValue() {
    return paramValue;
  }

  public void setParamValue(String paramValue) {
    this.paramValue = paramValue;
  }

  public String getPostFunc() {
    return postFunc;
  }

  public void setPostFunc(String postFunc) {
    this.postFunc = postFunc;
  }

  public String getTimeout() {
    return timeout;
  }

  public void setTimeout(String timeout) {
    this.timeout = timeout;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getUseTitleBar() {
    return useTitleBar;
  }

  public void setUseTitleBar(String useTitleBar) {
    this.useTitleBar = useTitleBar;
  }

  public int doStartTag() throws JspException {
    this.baseUrl = (String) ExpressionEvaluatorManager.evaluate("baseUrl", this.baseUrl,
        String.class, this, super.pageContext);
    this.paramValue = (String) ExpressionEvaluatorManager.evaluate("paramValue", this.paramValue,
        String.class, this, super.pageContext);
    if (this.title != null) {
      this.title = (String) ExpressionEvaluatorManager.evaluate("title", this.title, String.class,
          this, super.pageContext);
    }
    return SKIP_BODY;
  }

  public int doEndTag() throws JspException {
    Object[] arguments = { this.anchorId, this.classNamePrefix, this.baseUrl, this.paramName,
        this.paramValue, this.boxPosition, this.useTitleBar, this.title, this.timeout,
        this.postFunc, this.emptyFunc, this.errorFunc };
    String pattern = "<script type=\"text/javascript\">\n  callout(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\", \"{6}\", \"{7}\", {8}, {9}, {10}, {11});\n</script>\n\n";

    JspWriter writer = pageContext.getOut();
    try {
      writer.println(MessageFormat.format(pattern, arguments));
    } catch (IOException e) {
      throw new JspException(e.getMessage());
    }
    return EVAL_PAGE;
  }

  public void release() {
    this.anchorId = null;
    this.classNamePrefix = null;
    this.baseUrl = null;
    this.paramName = null;
    this.paramValue = null;
    this.boxPosition = null;
    this.title = null;
    this.useTitleBar = null;
    this.timeout = null;
    this.postFunc = null;
    this.emptyFunc = null;
    this.errorFunc = null;
    super.release();
  }

}

⌨️ 快捷键说明

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