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

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

?? selecttag.java

?? spring framework 2.5.4源代碼
?? JAVA
字號:
/*
 * 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.Collection;
import java.util.Map;

import javax.servlet.jsp.JspException;

import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.servlet.support.BindStatus;

/**
 * Databinding-aware JSP tag that renders an HTML '<code>select</code>'
 * element.
 *
 * <p>Inner '<code>option</code>' tags can be rendered using one of the
 * approaches supported by the OptionWriter class.
 *
 * <p>Also supports the use of nested {@link OptionTag OptionTags} or
 * (typically one) nested {@link OptionsTag}.
 *
 * @author Rob Harrop
 * @author Juergen Hoeller
 * @since 2.0
 * @see OptionTag
 */
public class SelectTag extends AbstractHtmlInputElementTag {

	/**
	 * The {@link javax.servlet.jsp.PageContext} attribute under
	 * which the bound value is exposed to inner {@link OptionTag OptionTags}.
	 */
	public static final String LIST_VALUE_PAGE_ATTRIBUTE =
			"org.springframework.web.servlet.tags.form.SelectTag.listValue";

	/**
	 * Marker object for items that have been specified but resolve to null.
	 * Allows to differentiate between 'set but null' and 'not set at all'.
	 */
	private static final Object EMPTY = new Object();


	/**
	 * The {@link Collection}, {@link Map} or array of objects used to generate the inner
	 * '<code>option</code>' tags.
	 */
	private Object items;

	/**
	 * The name of the property mapped to the '<code>value</code>' attribute
	 * of the '<code>option</code>' tag.
	 */
	private String itemValue;

	/**
	 * The name of the property mapped to the inner text of the
	 * '<code>option</code>' tag.
	 */
	private String itemLabel;

	/**
	 * The value of the HTML '<code>size</code>' attribute rendered
	 * on the final '<code>select</code>' element.
	 */
	private String size;

	/**
	 * Indicates whether or not the '<code>select</code>' tag allows
	 * multiple-selections.
	 */
	private Object multiple = Boolean.FALSE;

	/**
	 * The {@link TagWriter} instance that the output is being written.
	 * <p>Only used in conjunction with nested {@link OptionTag OptionTags}.
	 */
	private TagWriter tagWriter;


	/**
	 * Set the {@link Collection}, {@link Map} or array of objects used to
	 * generate the inner '<code>option</code>' tags.
	 * <p>Required when wishing to render '<code>option</code>' tags from
	 * an array, {@link Collection} or {@link Map}.
	 * <p>Typically a runtime expression.
	 * @param items the items that comprise the options of this selection
	 */
	public void setItems(Object items) {
		this.items = (items != null ? items : EMPTY);
	}

	/**
	 * Get the value of the '<code>items</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	protected Object getItems() {
		return this.items;
	}

	/**
	 * Set the name of the property mapped to the '<code>value</code>'
	 * attribute of the '<code>option</code>' tag.
	 * <p>Required when wishing to render '<code>option</code>' tags from
	 * an array or {@link Collection}.
	 * <p>May be a runtime expression.
	 */
	public void setItemValue(String itemValue) {
		this.itemValue = itemValue;
	}

	/**
	 * Get the value of the '<code>itemValue</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	protected String getItemValue() {
		return this.itemValue;
	}

	/**
	 * Set the name of the property mapped to the label (inner text) of the
	 * '<code>option</code>' tag.
	 * <p>May be a runtime expression.
	 */
	public void setItemLabel(String itemLabel) {
		this.itemLabel = itemLabel;
	}

	/**
	 * Get the value of the '<code>itemLabel</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	protected String getItemLabel() {
		return this.itemLabel;
	}

	/**
	 * Set the value of the HTML '<code>size</code>' attribute rendered
	 * on the final '<code>select</code>' element.
	 * <p>May be a runtime expression.
	 * @param size the desired value of the '<code>size</code>' attribute
	 */
	public void setSize(String size) {
		this.size = size;
	}

	/**
	 * Get the value of the '<code>size</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	protected String getSize() {
		return this.size;
	}

	/**
	 * Set the value of the HTML '<code>multiple</code>' attribute rendered
	 * on the final '<code>select</code>' element.
	 * <p>May be a runtime expression.
	 */
	public void setMultiple(Object multiple) {
		this.multiple = multiple;
	}

	/**
	 * Get the value of the HTML '<code>multiple</code>' attribute rendered
	 * on the final '<code>select</code>' element.
	 * <p>May be a runtime expression.
	 */
	protected Object getMultiple() {
		return this.multiple;
	}


	/**
	 * Renders the HTML '<code>select</code>' tag to the supplied
	 * {@link TagWriter}.
	 * <p>Renders nested '<code>option</code>' tags if the
	 * {@link #setItems items} property is set, otherwise exposes the
	 * bound value for the nested {@link OptionTag OptionTags}.
	 */
	protected int writeTagContent(TagWriter tagWriter) throws JspException {
		tagWriter.startTag("select");
		writeDefaultAttributes(tagWriter);
		if (isMultiple()) {
			tagWriter.writeAttribute("multiple", "multiple");
		}
		tagWriter.writeOptionalAttributeValue("size", getDisplayString(evaluate("size", getSize())));

		Object items = getItems();
		if (items != null) {
			// Items specified, but might still be empty...
			if (items != EMPTY) {
				Object itemsObject = (items instanceof String ? evaluate("items", (String) items) : items);
				if (itemsObject != null) {
					String valueProperty = (getItemValue() != null ?
							ObjectUtils.getDisplayString(evaluate("itemValue", getItemValue())) : null);
					String labelProperty = (getItemLabel() != null ?
							ObjectUtils.getDisplayString(evaluate("itemLabel", getItemLabel())) : null);
					OptionWriter optionWriter =
							new OptionWriter(itemsObject, getBindStatus(), valueProperty, labelProperty, isHtmlEscape());
					optionWriter.writeOptions(tagWriter);
				}
			}
			tagWriter.endTag(true);
			writeHiddenTagIfNecessary(tagWriter);
			return SKIP_BODY;
		}
		else {
			// Using nested <form:option/> tags, so just expose the value in the PageContext...
			tagWriter.forceBlock();
			this.tagWriter = tagWriter;
			this.pageContext.setAttribute(LIST_VALUE_PAGE_ATTRIBUTE, getBindStatus());
			return EVAL_BODY_INCLUDE;
		}
	}

	/**
	 * If using a multi-select, a hidden element is needed to make sure all
	 * items are correctly unselected on the server-side in response to a
	 * <code>null</code> post.
	 */
	private void writeHiddenTagIfNecessary(TagWriter tagWriter) throws JspException {
		if (isMultiple()) {
			tagWriter.startTag("input");
			tagWriter.writeAttribute("type", "hidden");
			tagWriter.writeAttribute("name", WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + getName());
			tagWriter.writeAttribute("value", "1");
			tagWriter.endTag();
		}
	}

	private boolean isMultiple() throws JspException {
		Object multiple = getMultiple();
		if (Boolean.TRUE.equals(multiple) || "true".equals(multiple) || "multiple".equals(multiple)) {
			return true;
		}
		else if (this.multiple instanceof String) {
			Object evaluatedValue = evaluate("multiple", multiple);
			return Boolean.TRUE.equals(evaluatedValue);
		}
		return forceMultiple();
	}

	/**
	 * Returns '<code>true</code>' if the bound value requires the
	 * resultant '<code>select</code>' tag to be multi-select.
	 */
	private boolean forceMultiple() throws JspException {
		BindStatus bindStatus = getBindStatus();
		Class valueType = bindStatus.getValueType();
		if (valueType != null && typeRequiresMultiple(valueType)) {
			return true;
		}
		else if (bindStatus.getEditor() != null) {
			Object editorValue = bindStatus.getEditor().getValue();
			if (editorValue != null && typeRequiresMultiple(editorValue.getClass())) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Returns '<code>true</code>' for arrays, {@link Collection Collections}
	 * and {@link Map Maps}.
	 */
	private static boolean typeRequiresMultiple(Class type) {
		return (type.isArray() || Collection.class.isAssignableFrom(type) || Map.class.isAssignableFrom(type));
	}

	/**
	 * Closes any block tag that might have been opened when using
	 * nested {@link OptionTag options}.
	 */
	public int doEndTag() throws JspException {
		if (this.tagWriter != null) {
			this.tagWriter.endTag();
			writeHiddenTagIfNecessary(tagWriter);
		}
		return EVAL_PAGE;
	}

	/**
	 * Clears the {@link TagWriter} that might have been left over when using
	 * nested {@link OptionTag options}.
	 */
	public void doFinally() {
		super.doFinally();
		this.tagWriter = null;
		this.pageContext.removeAttribute(LIST_VALUE_PAGE_ATTRIBUTE);
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
aaa国产一区| 成人教育av在线| 欧美国产激情一区二区三区蜜月| 国产成人免费视频网站| 亚洲图片欧美一区| 久久色视频免费观看| 国产精品亚洲第一| 亚洲综合视频在线观看| 久久久精品免费观看| 欧美日韩国产大片| 粉嫩绯色av一区二区在线观看| 亚洲成人av电影| 国产亚洲欧美在线| 99久久精品99国产精品| 日韩avvvv在线播放| 国产精品你懂的在线| 91精品国产福利在线观看| 岛国精品在线观看| 奇米精品一区二区三区四区| 亚洲欧美另类图片小说| 337p粉嫩大胆色噜噜噜噜亚洲 | 欧美片网站yy| 成人精品一区二区三区中文字幕| 亚洲精品免费在线| 国产亚洲精品中文字幕| 5月丁香婷婷综合| 99re热这里只有精品免费视频| 亚洲一区中文在线| 国产精品另类一区| 精品精品国产高清a毛片牛牛| 成人爽a毛片一区二区免费| 麻豆精品新av中文字幕| 亚洲一区二区三区四区中文字幕 | 精品国产91亚洲一区二区三区婷婷| 最新不卡av在线| 精品国产乱子伦一区| 欧美性感一区二区三区| 成人av午夜电影| 国产福利一区二区三区视频在线 | 亚洲成a人v欧美综合天堂| 国产精品三级av在线播放| 久久一日本道色综合| 4438亚洲最大| 欧美人妖巨大在线| 欧美视频一区二区在线观看| 91福利区一区二区三区| 国产精品一区二区三区99| 久久国产精品99久久久久久老狼| 午夜久久久久久| 国产精品影视天天线| 美女免费视频一区| 日韩 欧美一区二区三区| 亚洲v中文字幕| 一区二区三区国产豹纹内裤在线| 精品sm在线观看| 日本va欧美va精品| 丝袜诱惑亚洲看片 | 午夜精品久久一牛影视| 一区二区三区四区在线免费观看| 2019国产精品| 欧美日韩你懂得| 欧美成人精品1314www| 久久久久久久久久久久久久久99| 国产精品日韩精品欧美在线| 亚洲免费观看视频| 蜜桃91丨九色丨蝌蚪91桃色| 国产91丝袜在线播放| 在线观看av一区| 26uuu精品一区二区| 最近日韩中文字幕| 美女www一区二区| 成人av网站在线观看免费| 欧美私人免费视频| 久久久久久99精品| 依依成人精品视频| 韩国女主播一区| 欧美视频精品在线观看| 久久伊99综合婷婷久久伊| 亚洲激情在线激情| 首页国产丝袜综合| 久久九九久久九九| 亚洲激情欧美激情| 免费观看日韩电影| 91视频免费观看| 欧美变态凌虐bdsm| 亚洲猫色日本管| 久久机这里只有精品| 91免费版在线看| 精品久久99ma| 一区二区久久久| 国产精品一二二区| 3d成人h动漫网站入口| 中文字幕一区二区三区四区不卡 | 久久99精品国产麻豆婷婷| www.日本不卡| 日韩一二三区不卡| 亚洲靠逼com| 国产精品1区2区3区在线观看| 欧美亚洲自拍偷拍| 国产精品嫩草影院com| 蜜臀av在线播放一区二区三区| 99精品欧美一区二区三区小说| 精品国产露脸精彩对白| 婷婷久久综合九色综合绿巨人 | 久久久久久久电影| 亚洲在线中文字幕| 成人avav影音| 洋洋成人永久网站入口| 国产风韵犹存在线视精品| 日韩欧美亚洲国产精品字幕久久久| 亚洲天堂福利av| 国产剧情一区在线| 精品国产区一区| 免费高清在线视频一区·| 在线免费精品视频| 亚洲特黄一级片| 成人aaaa免费全部观看| 中文字幕av在线一区二区三区| 国产中文一区二区三区| 欧美二区在线观看| 午夜成人免费视频| 在线不卡免费av| 亚洲bt欧美bt精品777| 91极品美女在线| 一区二区三区在线视频观看| 91尤物视频在线观看| 国产精品国产自产拍高清av王其| 成人免费视频国产在线观看| 欧美激情一区二区在线| 成人高清免费观看| 亚洲欧洲国产专区| 暴力调教一区二区三区| 国产精品伦一区| 97国产一区二区| 夜夜精品视频一区二区| 欧美三级资源在线| 丝袜亚洲精品中文字幕一区| 欧美日韩dvd在线观看| 日本亚洲天堂网| 日韩精品一区在线观看| 国产一区二区中文字幕| 国产丝袜在线精品| 99久久亚洲一区二区三区青草| 亚洲天堂成人在线观看| 欧美体内she精高潮| 日韩精品一级二级| 日韩精品一区在线| 国产精品资源站在线| 国产精品福利电影一区二区三区四区 | 日韩精品三区四区| 欧美一区二区女人| 国产精品一区二区x88av| 国产精品情趣视频| 欧美视频中文字幕| 久久精品国产亚洲a| 国产视频一区二区在线观看| 97久久久精品综合88久久| 亚洲综合精品自拍| 欧美一级片在线看| 国产一区 二区 三区一级| 日韩一区中文字幕| 欧美理论在线播放| 国产精品一区2区| 一区二区理论电影在线观看| 日韩亚洲欧美综合| 成人黄色片在线观看| 亚洲成人资源网| 久久久综合九色合综国产精品| proumb性欧美在线观看| 日韩精品免费专区| 中文字幕av资源一区| 欧美精品久久一区二区三区| 国产麻豆一精品一av一免费| 一区二区三区在线免费| 精品国产一区二区亚洲人成毛片 | 蜜臀av一区二区| 国产精品毛片久久久久久| 国产三级一区二区| 欧美性videosxxxxx| 国内一区二区在线| 亚洲国产日日夜夜| 欧美激情一区在线| 欧美剧情片在线观看| 国产成人一区在线| 午夜精品久久久久久久久久| 国产精品丝袜黑色高跟| 欧美日本乱大交xxxxx| 波多野结衣中文一区| 日韩精品每日更新| 中文字幕av不卡| 精品乱码亚洲一区二区不卡| 91久久精品网| 成人av在线电影| 精品一区二区精品| 亚洲v中文字幕| 亚洲九九爱视频| 中文字幕av在线一区二区三区| 日韩精品资源二区在线| 欧美丝袜第三区| 色狠狠一区二区三区香蕉|