亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? labeltag.java

?? STRUTS數(shù)據(jù)庫項目開發(fā)寶典
?? JAVA
字號:
package com.relationinfo.webapp.taglib;import java.io.IOException;import java.util.List;import java.util.Locale;import javax.servlet.http.HttpServletRequest;import javax.servlet.jsp.JspException;import javax.servlet.jsp.tagext.TagSupport;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.apache.commons.validator.Field;import org.apache.commons.validator.Form;import org.apache.commons.validator.ValidatorResources;import org.springframework.beans.factory.BeanFactoryUtils;import org.springframework.beans.factory.NoSuchBeanDefinitionException;import org.springframework.context.MessageSource;import org.springframework.context.NoSuchMessageException;import org.springframework.validation.Errors;import org.springframework.validation.ObjectError;import org.springframework.web.context.support.WebApplicationContextUtils;import org.springframework.web.context.WebApplicationContext;import org.springframework.web.servlet.support.RequestContext;import org.springframework.web.servlet.DispatcherServlet;import org.springmodules.commons.validator.ValidatorFactory;/** * <p>This class is designed to render a <label> tag for labeling your forms and * adds an asterik (*) for required fields.  It was originally written by Erik * Hatcher (http://www.ehatchersolutions.com/JavaDevWithAnt/).</p> * * <p>It is designed to be used as follows: * <pre>&lt;tag:label key="userForm.username" /&gt;</pre> * </p> * * @jsp.tag name="label" bodycontent="empty" */public class LabelTag extends TagSupport {       protected RequestContext requestContext;    protected transient final Log log = LogFactory.getLog(LabelTag.class);    protected String key = null;    protected String styleClass = null;    protected String errorClass = null;    protected boolean colon = true;    protected boolean helpTip = false;    public int doStartTag() throws JspException {                try {            this.requestContext =                   new RequestContext((HttpServletRequest) this.pageContext.getRequest());        }        catch (RuntimeException ex) {            throw ex;        }        catch (Exception ex) {            pageContext.getServletContext().log("Exception in custom tag", ex);        }                // Look up this key to see if its a field of the current form        boolean requiredField = false;        boolean validationError = false;        ValidatorResources resources = getValidatorResources();                Locale locale = pageContext.getRequest().getLocale();        if (locale == null) {            locale = Locale.getDefault();        }                // get the name of the bean from the key        String formName = key.substring(0, key.indexOf('.'));        String fieldName = key.substring(formName.length() + 1);        if (resources != null) {            Form form = resources.getForm(locale, formName);            if (form != null) {                Field field = form.getField(fieldName);                if (field != null) {                    if (field.isDependency("required")) {                        requiredField = true;                    }                }            }        }		Errors errors = requestContext.getErrors(formName, false);        List fes = null;        String errorMsg = null;        if (errors != null) {            fes = errors.getFieldErrors(fieldName);            errorMsg = getErrorMessages(fes);        }        // Retrieve the message string we are looking for        String message = null;        try {        	message = getMessageSource().getMessage(key, null, locale);        } catch (NoSuchMessageException nsm) {            message = "???" + key + "???";        }                String cssClass = null;        if (styleClass != null) {            cssClass = styleClass;        } else if (requiredField) {            cssClass = "required";        }        String cssErrorClass = (errorClass != null) ? errorClass : "error";        StringBuffer label = new StringBuffer();        if ((message == null) || "".equals(message.trim())) {            label.append("");        } else {            label.append("<label for=\"" + fieldName + "\"");            if (validationError) {                label.append(" class=\"" + cssErrorClass + "\"");            } else if (cssClass != null) {                label.append(" class=\"" + cssClass + "\"");            }            label.append(">" + ((requiredField) ? "* " : "") + message);            String marker = (locale.equals(Locale.FRENCH)) ? " :" : ":";            label.append(((colon) ? marker : "") + "</label>");                        if (fes != null && fes.size() > 0) {                                if (helpTip) {                    label.append(" <a class=\"errorLink\" href=\"?\" onclick=\"showHelpTip(event, '");                    label.append(errorMsg + "', false); return false\" ");                    label.append("onmouseover=\"showHelpTip(event, '");                    label.append(errorMsg + "', false); return false\" ");                    label.append("onmouseout=\"hideHelpTip(event); return false\">");                }                                label.append("<img class=\"validationWarning\" alt=\"");                label.append(getMessageSource().getMessage("icon.warning", null, locale));                label.append("\"");                String context =                    ((HttpServletRequest) pageContext.getRequest()).getContextPath();                label.append("src=\"" + context);                label.append(getMessageSource().getMessage("icon.warning.img", null, locale));                label.append("\" />");                                if (helpTip) {                    label.append("</a>");                }            }        }        // Print the retrieved message to our output writer        try {            writeMessage(label.toString());        } catch (IOException io) {            io.printStackTrace();            throw new JspException("Error writing label: " + io.getMessage());        }        // Continue processing this page        return (SKIP_BODY);    }    /**     * Extract the error messages from the given ObjectError list.     */    private String getErrorMessages(List fes) throws NoSuchMessageException {        StringBuffer message = new StringBuffer();        for (int i = 0; i < fes.size(); i++) {            ObjectError error = (ObjectError) fes.get(i);            message.append(this.requestContext.getMessage(error, true));        }        return message.toString();    }    /**     * Write the message to the page.     * @param msg the message to write     * @throws IOException if writing failed     */    protected void writeMessage(String msg) throws IOException {        pageContext.getOut().write(msg);    }        /**     * @jsp.attribute required="true" rtexprvalue="true"     */    public void setKey(String key) {        this.key = key;    }    /**     * Setter for specifying whether to include colon     * @jsp.attribute required="false" rtexprvalue="true"     */    public void setColon(boolean colon) {        this.colon = colon;    }    /**     * Setter for assigning a CSS class, default is label.     *     * @jsp.attribute required="false" rtexprvalue="true"     */    public void setStyleClass(String styleClass) {        this.styleClass = styleClass;    }    /**     * Setter for assigning a CSS class when errors occur,     * defaults to labelError.     *     * @jsp.attribute required="false" rtexprvalue="true"     */    public void setErrorClass(String errorClass) {        this.errorClass = errorClass;    }    /**     * Setter for displaying a JavaScript popup helptip.  Default     * is false because error text is shown next to field.     *     * @jsp.attribute required="false" rtexprvalue="true"     */    public void setHelpTip(boolean helpTip) {        this.helpTip = helpTip;    }        /**     * Release all allocated resources.     */    public void release() {        super.release();        key = null;        colon = true;        styleClass = null;        errorClass = null;        helpTip = false;    }        /**     * Get the validator resources from a ValidatorFactory defined in the     * web application context or one of its parent contexts.     * The bean is resolved by type (org.springframework.validation.commons.ValidatorFactory).     *     * @return ValidatorResources from a ValidatorFactory.     */    private ValidatorResources getValidatorResources() {        // look in servlet beans definition (i.e. action-servlet.xml)        WebApplicationContext ctx = (WebApplicationContext) pageContext.getRequest()            .getAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE);        ValidatorFactory factory = null;        try {            factory = (ValidatorFactory) BeanFactoryUtils                    .beanOfTypeIncludingAncestors(ctx, ValidatorFactory.class, true, true);        } catch (NoSuchBeanDefinitionException e) {            // look in main application context (i.e. applicationContext.xml)            ctx = WebApplicationContextUtils                    .getRequiredWebApplicationContext(pageContext.getServletContext());            factory = (ValidatorFactory) BeanFactoryUtils                    .beanOfTypeIncludingAncestors(ctx, ValidatorFactory.class, true, true);        }        return factory.getValidatorResources();    }        /**     * Use the application context itself for default message resolution.     */    private MessageSource getMessageSource() {        return requestContext.getWebApplicationContext();    }    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本青草视频在线怡红院 | 婷婷开心激情综合| 久久成人免费日本黄色| av在线不卡免费看| 久久久久综合网| 日本特黄久久久高潮| 在线一区二区观看| 国产精品久久久久婷婷| 久久91精品久久久久久秒播| 在线视频亚洲一区| 亚洲欧美日韩国产中文在线| 国产精品888| 精品国产乱码久久| 天天做天天摸天天爽国产一区| 高清不卡一二三区| 久久久99久久| 国内精品久久久久影院色| 欧美一级片在线| 日本午夜精品视频在线观看 | 26uuu欧美日本| 免费高清在线一区| 欧美一级免费大片| 日韩成人免费看| 欧美伦理影视网| 日韩精品午夜视频| 日韩一区二区免费在线观看| 五月天视频一区| 欧美日本精品一区二区三区| 亚洲午夜视频在线观看| 欧美三级中文字| 亚洲成在人线免费| 欧美一区二区视频在线观看| 香蕉久久夜色精品国产使用方法| 欧美日韩亚洲不卡| 午夜欧美电影在线观看| 欧美一区日本一区韩国一区| 免费在线观看视频一区| 日韩欧美的一区二区| 理论片日本一区| 国产亚洲精品精华液| 成人综合在线观看| 亚洲精品乱码久久久久久久久 | 欧美电影免费观看高清完整版在线 | 色哟哟国产精品| 亚洲午夜精品一区二区三区他趣| 欧美四级电影在线观看| 视频一区欧美日韩| 精品福利一区二区三区免费视频| 经典三级在线一区| 国产精品欧美一区二区三区| 99精品欧美一区二区三区综合在线| 亚洲视频一二区| 欧美丰满一区二区免费视频| 精品一区二区三区影院在线午夜| 久久众筹精品私拍模特| eeuss鲁片一区二区三区| 一卡二卡欧美日韩| 日韩免费观看高清完整版| 国产一区二区三区| 亚洲精品日韩一| 欧美xxxxxxxxx| 成人app软件下载大全免费| 一个色综合av| 精品久久久影院| 色欧美日韩亚洲| 韩国理伦片一区二区三区在线播放| 自拍av一区二区三区| 日韩欧美一级二级三级久久久| 丰满少妇久久久久久久| 亚洲一区二区三区四区在线免费观看 | 91精品免费观看| 成人免费毛片片v| 日韩精品乱码免费| 亚洲少妇最新在线视频| 精品久久久网站| 欧美日韩国产高清一区二区| 韩国女主播成人在线观看| 亚洲综合图片区| 欧美激情一区二区三区| 91精品国产综合久久婷婷香蕉| 成人的网站免费观看| 男男成人高潮片免费网站| 亚洲美女视频在线观看| 久久久亚洲精品石原莉奈| 欧美日韩国产综合一区二区 | 夜夜精品视频一区二区| 久久精品欧美日韩| 日韩精品在线网站| 91极品视觉盛宴| 成人h版在线观看| 国产精品自拍三区| 久久99最新地址| 日本中文字幕不卡| 天天影视色香欲综合网老头| 亚洲视频一区二区在线观看| 国产农村妇女毛片精品久久麻豆| 日韩一区二区三区免费看| 欧美精品一级二级| 色视频欧美一区二区三区| av影院午夜一区| 国产成a人亚洲精品| 国产美女在线观看一区| 狠狠色综合播放一区二区| 五月激情综合色| 日日噜噜夜夜狠狠视频欧美人 | 国产一区免费电影| 狠狠色丁香婷综合久久| 日韩综合在线视频| 轻轻草成人在线| 热久久久久久久| 麻豆久久一区二区| 老司机精品视频一区二区三区| 麻豆成人久久精品二区三区红| 免费av网站大全久久| 美女一区二区三区在线观看| 久久精品国产精品亚洲综合| 久久超级碰视频| 国产精品66部| 成人精品视频一区二区三区尤物| 成人a免费在线看| 91年精品国产| 欧美色精品在线视频| 7777女厕盗摄久久久| 欧美一级理论片| 2020日本不卡一区二区视频| 国产无遮挡一区二区三区毛片日本| 日韩精品中文字幕一区二区三区| 久久久蜜桃精品| 国产精品久久久久久久浪潮网站| 国产精品高清亚洲| 亚洲综合丝袜美腿| 久久成人久久爱| 波波电影院一区二区三区| 99re66热这里只有精品3直播| 色国产精品一区在线观看| 91精品国产综合久久精品| 国产亚洲成aⅴ人片在线观看 | 日本系列欧美系列| 国产精品一线二线三线精华| 99在线精品视频| 91精品国产综合久久香蕉麻豆 | 日韩欧美卡一卡二| 日本一区二区三区高清不卡| 亚洲视频免费在线观看| 天堂成人国产精品一区| 狠狠色狠狠色合久久伊人| 99久久99久久综合| 欧美一区二区三区人| 国产欧美日韩视频在线观看| 亚洲少妇30p| 国产在线精品一区二区不卡了| 99久久伊人久久99| 欧美一区二区三区在线看| 欧美国产日韩在线观看| 亚洲va欧美va人人爽午夜| 国产一区二区三区电影在线观看 | 成人午夜电影网站| 欧美高清你懂得| 亚洲视频一二三| 久久99精品国产麻豆不卡| 91丨九色丨蝌蚪丨老版| 精品va天堂亚洲国产| 一区二区欧美国产| 国产精品一二三区在线| 欧美电影一区二区| 亚洲精品视频免费观看| 黑人精品欧美一区二区蜜桃| 在线观看av一区二区| 久久精品这里都是精品| 天天影视涩香欲综合网| 色婷婷香蕉在线一区二区| 国产视频911| 捆绑变态av一区二区三区| 欧美无砖专区一中文字| 一区在线观看免费| 国产不卡视频一区| 欧美成人官网二区| 秋霞电影一区二区| 欧美日韩一区二区三区不卡| 中文字幕日本乱码精品影院| 国产伦精品一区二区三区免费迷 | 欧美日韩黄色一区二区| 综合久久国产九一剧情麻豆| 国产不卡一区视频| 26uuu国产电影一区二区| 美女免费视频一区| 欧美一级搡bbbb搡bbbb| 日韩精品一二区| 91精品国产综合久久久久久久久久 | 美国欧美日韩国产在线播放| 欧美日韩午夜影院| 一区二区免费视频| 欧美写真视频网站| 亚洲高清免费观看高清完整版在线观看| 成人午夜在线播放| 国产精品全国免费观看高清| 懂色av一区二区在线播放| 久久―日本道色综合久久| 九九精品一区二区| 国产校园另类小说区|