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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? errorstag.java

?? spring framework 2.5.4源代碼
?? JAVA
字號(hào):
/*
 * Copyright 2002-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.web.servlet.tags.form;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyTag;

import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

/**
 * Form tag for displaying errors for a particular field or object.
 *
 * <p>This tag supports three main usage patterns:
 *
 * <ol>
 *	<li>Field only - set '<code>path</code>' to the field name (or path)</li>
 *	<li>Object errors only - omit '<code>path</code>'</li>
 *	<li>All errors - set '<code>path</code>' to '<code>*</code>'</li>
 * </ol>
 *
 * @author Rob Harrop
 * @author Juergen Hoeller
 * @author Rick Evans
 * @since 2.0
 */
public class ErrorsTag extends AbstractHtmlElementBodyTag implements BodyTag {

	/**
	 * The key under which this tag exposes error messages in
	 * the {@link PageContext#PAGE_SCOPE page context scope}.
	 */
	public static final String MESSAGES_ATTRIBUTE = "messages";

	/**
	 * The HTML '<code>span</code>' tag.
	 */
	public static final String SPAN_TAG = "span";


	private String element = SPAN_TAG;

	private String delimiter = "<br/>";

	/**
	 * Stores any value that existed in the 'errors messages' before the tag was started.
	 */
	private Object oldMessages;

	private boolean errorMessagesWereExposed;


	/**
	 * Set the HTML element must be used to render the error messages.
	 * <p>Defaults to an HTML '<code>&lt;span/&gt;</code>' tag.
	 */
	public void setElement(String element) {
		Assert.hasText(element, "'element' cannot be null or blank");
		this.element = element;
	}

	/**
	 * Get the HTML element must be used to render the error messages.
	 */
	public String getElement() {
		return this.element;
	}

	/**
	 * Set the delimiter to be used between error messages.
	 * <p>Defaults to an HTML '<code>&lt;br/&gt;</code>' tag.
	 */
	public void setDelimiter(String delimiter) {
		this.delimiter = delimiter;
	}

	/**
	 * Return the delimiter to be used between error messages.
	 */
	public String getDelimiter() {
		return this.delimiter;
	}


	/**
	 * Get the value for the HTML '<code>name</code>' attribute.
	 * <p>Simply returns <code>null</code> because the '<code>name</code>' attribute
	 * is not a validate attribute for the '<code>span</code>' element.
	 */
	protected String getName() throws JspException {
		return null;
	}

	/**
	 * Get the value for the HTML '<code>id</code>' attribute.
	 * <p>Appends '<code>.errors</code>' to the value returned by {@link #getPropertyPath()}
	 * or to the model attribute name if the <code>&lt;form:errors/&gt;</code> tag's
	 * '<code>path</code>' attribute has been omitted.
	 * @return the value for the HTML '<code>id</code>' attribute
	 * @see #getPropertyPath()
	 */
	protected String autogenerateId() throws JspException {
		String path = getPropertyPath();
		if ("".equals(path)) {
			path = (String) this.pageContext.getAttribute(
					FormTag.MODEL_ATTRIBUTE_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
		}
		return path + ".errors";
	}

	/**
	 * Should rendering of this tag proceed at all?
	 * <p>Only renders output when there are errors for the configured {@link #setPath path}.
	 * @return <code>true</code> only when there are errors for the configured {@link #setPath path}
	 */
	protected boolean shouldRender() throws JspException {
		try {
			return getBindStatus().isError();
		}
		catch (IllegalStateException ex) {
			// Neither BindingResult nor target object available.
			return false;
		}
	}

	protected void renderDefaultContent(TagWriter tagWriter) throws JspException {
		tagWriter.startTag(getElement());
		writeDefaultAttributes(tagWriter);
		String delimiter = ObjectUtils.getDisplayString(evaluate("delimiter", getDelimiter()));
		String[] errorMessages = getBindStatus().getErrorMessages();
		for (int i = 0; i < errorMessages.length; i++) {
			String errorMessage = errorMessages[i];
			if (i > 0) {
				tagWriter.appendValue(delimiter);
			}
			tagWriter.appendValue(getDisplayString(errorMessage));
		}
		tagWriter.endTag();
	}

	/**
	 * Exposes any bind status error messages under {@link #MESSAGES_ATTRIBUTE this key}
	 * in the {@link PageContext#PAGE_SCOPE}.
	 * <p>Only called if {@link #shouldRender()} returns <code>true</code>.
	 * @see #removeAttributes()
	 */
	protected void exposeAttributes() throws JspException {
		List errorMessages = new ArrayList();
		errorMessages.addAll(Arrays.asList(getBindStatus().getErrorMessages()));
		this.oldMessages = this.pageContext.getAttribute(MESSAGES_ATTRIBUTE, PageContext.PAGE_SCOPE);
		this.pageContext.setAttribute(MESSAGES_ATTRIBUTE, errorMessages, PageContext.PAGE_SCOPE);
		this.errorMessagesWereExposed = true;
	}

	/**
	 * Removes any bind status error messages that were previously stored under
	 * {@link #MESSAGES_ATTRIBUTE this key} in the {@link PageContext#PAGE_SCOPE}.
	 * @see #exposeAttributes()
	 */
	protected void removeAttributes() {
		if (this.errorMessagesWereExposed) {
			if (this.oldMessages != null) {
				this.pageContext.setAttribute(MESSAGES_ATTRIBUTE, this.oldMessages, PageContext.PAGE_SCOPE);
				this.oldMessages = null;
			}
			else {
				this.pageContext.removeAttribute(MESSAGES_ATTRIBUTE, PageContext.PAGE_SCOPE);
			}
		}
	}

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费在线观看| 91美女视频网站| 国产91富婆露脸刺激对白| 国产成人精品三级麻豆| 色综合久久久网| 欧美一区二区三区喷汁尤物| 久久久久久久久久久电影| 亚洲人吸女人奶水| 老司机精品视频线观看86| 成人爱爱电影网址| 日韩欧美一区二区在线视频| 中文字幕乱码一区二区免费| 日韩黄色片在线观看| 精品国免费一区二区三区| 一区二区三区日韩欧美| 国产成人综合网站| 欧美精品xxxxbbbb| 亚洲视频一区在线| 国产一区二区三区在线观看免费视频 | 成人av高清在线| 精品国产免费一区二区三区香蕉 | 麻豆高清免费国产一区| 日本韩国精品在线| 国产清纯在线一区二区www| 日韩高清欧美激情| 日本韩国一区二区| 亚洲黄色免费网站| 91色综合久久久久婷婷| 国产精品免费看片| 国产精品一区2区| 精品国产免费久久| 另类的小说在线视频另类成人小视频在线 | 精品久久久久久久久久久久包黑料| 亚洲综合一区在线| 欧美性受xxxx| 国产乱对白刺激视频不卡| 欧美久久久久久蜜桃| 亚洲在线观看免费视频| 欧亚一区二区三区| 亚洲成av人在线观看| 欧美日韩一区二区三区视频| 日韩不卡一区二区| 欧美不卡在线视频| 岛国av在线一区| 亚洲最新在线观看| 69堂亚洲精品首页| 国产一区二区网址| 亚洲女爱视频在线| 91精品婷婷国产综合久久| 另类小说色综合网站| 国产欧美日韩在线视频| 色婷婷综合久久久| 精品一区二区在线视频| 亚洲欧美在线观看| 678五月天丁香亚洲综合网| 久久精品国产亚洲a| 中文字幕一区二区三区四区不卡| 欧美性色黄大片手机版| 久久精品999| 一区二区三区久久久| 欧美大片日本大片免费观看| 91啪亚洲精品| 蜜臀久久久久久久| 亚洲精品伦理在线| 日韩视频不卡中文| aaa国产一区| 国产一区欧美二区| 午夜精品123| 国产精品成人一区二区艾草| 日韩视频一区二区三区| 在线观看视频一区二区| 成人一区二区三区视频| 麻豆国产欧美一区二区三区| 亚洲免费观看在线视频| 国产日韩欧美麻豆| 日韩欧美高清dvd碟片| 欧美唯美清纯偷拍| 北岛玲一区二区三区四区| 国产尤物一区二区在线| 美女视频一区在线观看| 亚洲一区在线观看视频| 亚洲欧美激情视频在线观看一区二区三区| 欧美成人一区二区三区在线观看| 精品视频免费看| 欧美色区777第一页| 欧美视频一区在线| 欧美日韩日日夜夜| 欧美一区二区黄| 欧美日韩久久一区二区| 91精品欧美久久久久久动漫 | 日韩高清中文字幕一区| 日日摸夜夜添夜夜添国产精品| 亚洲精品免费在线| 一区二区成人在线| 亚洲成人777| 亚洲成人免费av| 久久精品国产精品青草| 经典一区二区三区| 国产成人午夜精品5599| 成人午夜视频福利| 色av成人天堂桃色av| 8v天堂国产在线一区二区| 日韩欧美一级二级三级久久久| 久久综合狠狠综合| 中文字幕视频一区| 亚洲h在线观看| 国产精品自拍毛片| 色播五月激情综合网| 欧美日韩1234| 精品国产伦一区二区三区观看体验| 精品国免费一区二区三区| 国产精品久久久久久久久果冻传媒| 亚洲免费观看高清完整版在线观看| 天天亚洲美女在线视频| 国产二区国产一区在线观看| 91视频一区二区三区| 日韩亚洲电影在线| 中文字幕一区二区日韩精品绯色 | 男女男精品视频| fc2成人免费人成在线观看播放| 欧美精品电影在线播放| 国产精品久99| 久久av老司机精品网站导航| 91高清视频在线| 久久久高清一区二区三区| 一区二区久久久| 国产一区 二区| 日韩欧美国产系列| 亚洲国产视频在线| 99久久婷婷国产精品综合| 欧美精品一区二| 日韩中文字幕不卡| 日本韩国欧美一区| 国产精品的网站| 国产成人av电影在线| 久久久久久久久97黄色工厂| 日本午夜精品视频在线观看| 欧美亚洲免费在线一区| 一区二区视频在线| 99久久精品国产一区| 中文字幕欧美激情一区| 黄色成人免费在线| 久久综合色一综合色88| 国产在线一区观看| 久久久精品影视| 99riav久久精品riav| 亚洲特级片在线| 99久久久无码国产精品| 国产精品初高中害羞小美女文| 99久久精品免费看国产免费软件| 国产精品欧美经典| 色综合久久天天| 天天影视网天天综合色在线播放 | 欧美日韩一区成人| 日本欧美大码aⅴ在线播放| 欧美一级精品在线| 国产乱人伦精品一区二区在线观看| 国产欧美精品区一区二区三区| 成人免费视频免费观看| 综合久久国产九一剧情麻豆| 色婷婷激情久久| 久久国产夜色精品鲁鲁99| 欧美xfplay| 色域天天综合网| 免费xxxx性欧美18vr| 国产色91在线| 欧美日韩一区二区三区视频| 国产最新精品精品你懂的| 亚洲视频在线观看一区| 欧美成人一级视频| 色就色 综合激情| 久久国产剧场电影| 亚洲精品videosex极品| 精品播放一区二区| 91在线视频在线| 日本va欧美va瓶| 国产精品麻豆久久久| 欧美一级高清片| 欧美怡红院视频| 国产美女精品一区二区三区| 亚洲国产综合人成综合网站| 久久精品在线观看| 日韩欧美国产三级| 欧美日韩精品系列| 色天使色偷偷av一区二区| 国产精品一二三四| 美脚の诱脚舐め脚责91| 亚洲一级二级三级在线免费观看| 欧美激情在线一区二区| 国产亚洲一区二区三区在线观看| 91精品国产aⅴ一区二区| 欧美色区777第一页| 日本道色综合久久| 色婷婷久久久亚洲一区二区三区| k8久久久一区二区三区| 国产盗摄女厕一区二区三区| 国模娜娜一区二区三区| 美女视频一区二区| 麻豆免费精品视频| 精品一区二区影视|