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

📄 ifvalidemailaddrtag.java

📁 JSP设计(第三版)一书源代码 JSP设计(第三版)》得到了充分的修订和更新
💻 JAVA
字号:
package com.ora.jsp.tags;

import javax.servlet.jsp.*;
import javax.servlet.jsp.jstl.core.*;
import org.apache.taglibs.standard.lang.support.*;
import com.ora.jsp.util.StringFormat;

/**
 * This class is a custom action for testing if a string value
 * is in the format of a valid SMTP email address.
 * If it is, the body is evaluated. If a var attribute is provided, 
 * the result is also saved as a Boolean variable in the specified 
 * scope, or in the page if no scope is specified.
 *
 * @author Hans Bergsten, Gefion software <hans@gefionsoftware.com>
 * @version 3.0
 */
public class IfValidEmailAddrTag extends ConditionalTagSupport {
    private String value;

    public void setValue(String value) {
	this.value = value;
    }

    public boolean condition() throws JspTagException {
	return StringFormat.isValidEmailAddr(value);
    }
}

⌨️ 快捷键说明

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