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

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

?? formtag.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 javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;

import org.springframework.beans.PropertyAccessor;
import org.springframework.core.Conventions;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.util.HtmlUtils;

/**
 * Databinding-aware JSP tag for rendering an HTML '<code>form</code>' whose
 * inner elements are bound to properties on a <em>form object</em>.
 *
 * <p>Users should place the form object into the
 * {@link org.springframework.web.servlet.ModelAndView ModelAndView} when
 * populating the data for their view. The name of this form object can be
 * configured using the {@link #setModelAttribute "modelAttribute"} property.
 *
 * <p>The default value for the {@link #setModelAttribute "modelAttribute"}
 * property is '<code>command</code>' which corresponds to the default name
 * when using the
 * {@link org.springframework.web.servlet.mvc.SimpleFormController SimpleFormController}.
 *
 * @author Rob Harrop
 * @author Juergen Hoeller
 * @since 2.0
 * @see org.springframework.web.servlet.mvc.SimpleFormController
 */
public class FormTag extends AbstractHtmlElementTag {

	/** The default HTTP method using which form values are sent to the server: "post" */
	private static final String DEFAULT_METHOD = "post";

	/** The default attribute name: &quot;command&quot; */
	public static final String DEFAULT_COMMAND_NAME = "command";

	private static final String ONSUBMIT_ATTRIBUTE = "onsubmit";

	private static final String ONRESET_ATTRIBUTE = "onreset";

	private static final String ACTION_ATTRIBUTE = "action";

	private static final String METHOD_ATTRIBUTE = "method";

	private static final String TARGET_ATTRIBUTE = "target";

	private static final String ENCTYPE_ATTRIBUTE = "enctype";

	private static final String ACCEPT_CHARSET_ATTRIBUTE = "accept-charset";

	/** The name of the '<code>modelAttribute</code>' setting */
	private static final String MODEL_ATTRIBUTE = "modelAttribute";

	/**
	 * The name of the {@link javax.servlet.jsp.PageContext} attribute under which the
	 * form object name is exposed.
	 */
	public static final String MODEL_ATTRIBUTE_VARIABLE_NAME =
			Conventions.getQualifiedAttributeName(AbstractFormTag.class, MODEL_ATTRIBUTE);


	private TagWriter tagWriter;

	private String modelAttribute = DEFAULT_COMMAND_NAME;

	private String name;

	private String action;

	private String method = DEFAULT_METHOD;

	private String target;

	private String enctype;

	private String onsubmit;

	private String onreset;

	private String acceptCharset;

	/** Caching a previous nested path, so that it may be reset */
	private String previousNestedPath;


	/**
	 * Set the name of the form attribute in the model.
	 * <p>May be a runtime expression.
	 */
	public void setModelAttribute(String modelAttribute) {
		this.modelAttribute = modelAttribute;
	}

	/**
	 * Get the name of the form attribute in the model.
	 */
	protected String getModelAttribute() {
		return this.modelAttribute;
	}

	/**
	 * Set the name of the form attribute in the model.
	 * <p>May be a runtime expression.
	 * @see #setModelAttribute
	 */
	public void setCommandName(String commandName) {
		this.modelAttribute = commandName;
	}

	/**
	 * Get the name of the form attribute in the model.
	 * @see #getModelAttribute
	 */
	protected String getCommandName() {
		return this.modelAttribute;
	}

	/**
	 * Set the value of the '<code>name</code>' attribute.
	 * <p>May be a runtime expression.
	 * <p>Name is not a valid attribute for form on XHTML 1.0. However,
	 * it is sometimes needed for backward compatibility.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Get the value of the '<code>name</code>' attribute.
	 */
	protected String getName() throws JspException {
		return this.name;
	}

	/**
	 * Set the value of the '<code>action</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	public void setAction(String action) {
		this.action = (action != null ? action : "");
	}

	/**
	 * Get the value of the '<code>action</code>' attribute.
	 */
	protected String getAction() {
		return this.action;
	}

	/**
	 * Set the value of the '<code>method</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	public void setMethod(String method) {
		this.method = method;
	}

	/**
	 * Get the value of the '<code>method</code>' attribute.
	 */
	protected String getMethod() {
		return this.method;
	}

	/**
	 * Set the value of the '<code>target</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	public void setTarget(String target) {
		this.target = target;
	}

	/**
	 * Get the value of the '<code>target</code>' attribute.
	 */
	public String getTarget() {
		return this.target;
	}

	/**
	 * Set the value of the '<code>enctype</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	public void setEnctype(String enctype) {
		this.enctype = enctype;
	}

	/**
	 * Get the value of the '<code>enctype</code>' attribute.
	 */
	protected String getEnctype() {
		return this.enctype;
	}

	/**
	 * Set the value of the '<code>acceptCharset</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	public void setAcceptCharset(String acceptCharset) {
		this.acceptCharset = acceptCharset;
	}

	/**
	 * Get the value of the '<code>acceptCharset</code>' attribute.
	 */
	protected String getAcceptCharset() {
		return this.acceptCharset;
	}

	/**
	 * Set the value of the '<code>onsubmit</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	public void setOnsubmit(String onsubmit) {
		this.onsubmit = onsubmit;
	}

	/**
	 * Get the value of the '<code>onsubmit</code>' attribute.
	 */
	protected String getOnsubmit() {
		return this.onsubmit;
	}

	/**
	 * Set the value of the '<code>onreset</code>' attribute.
	 * <p>May be a runtime expression.
	 */
	public void setOnreset(String onreset) {
		this.onreset = onreset;
	}

	/**
	 * Get the value of the '<code>onreset</code>' attribute.
	 */
	protected String getOnreset() {
		return this.onreset;
	}


	/**
	 * Writes the opening part of the block	'<code>form</code>' tag and exposes
	 * the form object name in the {@link javax.servlet.jsp.PageContext}.
	 * @param tagWriter the {@link TagWriter} to which the form content is to be written
	 * @return {@link javax.servlet.jsp.tagext.Tag#EVAL_BODY_INCLUDE}
	 */
	protected int writeTagContent(TagWriter tagWriter) throws JspException {
		this.tagWriter = tagWriter;

		tagWriter.startTag("form");
		writeDefaultAttributes(tagWriter);
		tagWriter.writeAttribute(ACTION_ATTRIBUTE, resolveAction());
		writeOptionalAttribute(tagWriter, METHOD_ATTRIBUTE, getMethod());
		writeOptionalAttribute(tagWriter, TARGET_ATTRIBUTE, getTarget());
		writeOptionalAttribute(tagWriter, ENCTYPE_ATTRIBUTE, getEnctype());
		writeOptionalAttribute(tagWriter, ONSUBMIT_ATTRIBUTE, getOnsubmit());
		writeOptionalAttribute(tagWriter, ONRESET_ATTRIBUTE, getOnreset());
		writeOptionalAttribute(tagWriter, ACCEPT_CHARSET_ATTRIBUTE, getAcceptCharset());

		tagWriter.forceBlock();

		// Expose the form object name for nested tags...
		String modelAttribute = resolveModelAttribute();
		this.pageContext.setAttribute(MODEL_ATTRIBUTE_VARIABLE_NAME, modelAttribute, PageContext.REQUEST_SCOPE);
		this.pageContext.setAttribute(COMMAND_NAME_VARIABLE_NAME, modelAttribute, PageContext.REQUEST_SCOPE);

		// Save previous nestedPath value, build and expose current nestedPath value.
		// Use request scope to expose nestedPath to included pages too.
		this.previousNestedPath =
				(String) this.pageContext.getAttribute(NESTED_PATH_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
		this.pageContext.setAttribute(NESTED_PATH_VARIABLE_NAME,
				modelAttribute + PropertyAccessor.NESTED_PROPERTY_SEPARATOR, PageContext.REQUEST_SCOPE);

		return EVAL_BODY_INCLUDE;
	}

	/**
	 * Autogenerated IDs correspond to the form object name.
	 */
	protected String autogenerateId() throws JspException {
		return resolveModelAttribute();
	}

	/**
	 * {@link #evaluate Resolves} and returns the name of the form object.
	 * @throws IllegalArgumentException if the form object resolves to <code>null</code>
	 */
	protected String resolveModelAttribute() throws JspException {
		Object resolvedModelAttribute = evaluate(MODEL_ATTRIBUTE, getModelAttribute());
		if (resolvedModelAttribute == null) {
			throw new IllegalArgumentException(MODEL_ATTRIBUTE + " must not be null");
		}
		return (String) resolvedModelAttribute;
	}

	/**
	 * Resolve the value of the '<code>action</code>' attribute.
	 * <p>If the user configured an '<code>action</code>' value then
	 * the result of evaluating this value is used. Otherwise, the
	 * {@link org.springframework.web.servlet.support.RequestContext#getRequestUri() originating URI}
	 * is used.
	 * @return the value that is to be used for the '<code>action</code>' attribute
	 */
	protected String resolveAction() throws JspException {
		String action = getAction();
		if (StringUtils.hasText(action)) {
			return getDisplayString(evaluate(ACTION_ATTRIBUTE, action));
		}
		else {
			String requestUri = getRequestContext().getRequestUri();
			ServletResponse response = this.pageContext.getResponse();
			if (response instanceof HttpServletResponse) {
				requestUri = ((HttpServletResponse) response).encodeURL(requestUri);
				String queryString = getRequestContext().getQueryString();
				if (StringUtils.hasText(queryString)) {
					requestUri += "?" + HtmlUtils.htmlEscape(queryString);
				}
			}
			if (StringUtils.hasText(requestUri)) {
				return requestUri;
			}
			else {
				throw new IllegalArgumentException("Attribute 'action' is required. " +
						"Attempted to resolve against current request URI but request URI was null.");
			}
		}
	}


	/**
	 * Closes the '<code>form</code>' block tag and removes the form object name
	 * from the {@link javax.servlet.jsp.PageContext}.
	 */
	public int doEndTag() throws JspException {
		this.tagWriter.endTag();
		this.pageContext.removeAttribute(MODEL_ATTRIBUTE_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
		this.pageContext.removeAttribute(COMMAND_NAME_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
		if (this.previousNestedPath != null) {
			// Expose previous nestedPath value.
			this.pageContext.setAttribute(NESTED_PATH_VARIABLE_NAME, this.previousNestedPath, PageContext.REQUEST_SCOPE);
		}
		else {
			// Remove exposed nestedPath value.
			this.pageContext.removeAttribute(NESTED_PATH_VARIABLE_NAME, PageContext.REQUEST_SCOPE);
		}
		return EVAL_PAGE;
	}

	/**
	 * Clears the stored {@link TagWriter}.
	 */
	public void doFinally() {
		super.doFinally();
		this.tagWriter = null;
		this.previousNestedPath = null;
	}


	/**
	 * Override resolve CSS class since error class is not supported.
	 */
	protected String resolveCssClass() throws JspException {
		return ObjectUtils.getDisplayString(evaluate("cssClass", getCssClass()));
	}

	/**
	 * Unsupported for forms.
	 * @throws UnsupportedOperationException always
	 */
	public void setPath(String path) {
		throw new UnsupportedOperationException("The 'path' attribute is not supported for forms");
	}

	/**
	 * Unsupported for forms.
	 * @throws UnsupportedOperationException always
	 */
	public void setCssErrorClass(String cssErrorClass) {
		throw new UnsupportedOperationException("The 'cssErrorClass' attribute is not supported for forms");
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美国毛片一区二区| 久久久久久久久久电影| 伊人性伊人情综合网| eeuss鲁一区二区三区| 中文字幕日韩一区| 色域天天综合网| 午夜视频在线观看一区二区| 欧美蜜桃一区二区三区| 蜜臀99久久精品久久久久久软件 | 成人激情图片网| 国产精品国产精品国产专区不片 | 日本伊人色综合网| 精品欧美一区二区在线观看| 国产成人精品亚洲777人妖| 激情都市一区二区| 亚洲r级在线视频| 91精品国产91久久久久久一区二区| 日本不卡123| 国产校园另类小说区| gogogo免费视频观看亚洲一| 亚洲成人免费电影| 久久综合精品国产一区二区三区| 懂色一区二区三区免费观看| 亚洲国产精品一区二区久久| 精品国产乱码久久久久久蜜臀| 丁香天五香天堂综合| 亚洲一区欧美一区| 久久久久久久久久久久久女国产乱 | 欧美久久久久久蜜桃| 国产精品1024久久| 亚洲图片有声小说| 国产亚洲一二三区| 欧美福利视频一区| av不卡在线观看| 麻豆免费精品视频| 一区二区成人在线视频| 久久在线免费观看| 欧美日韩日本视频| 成人福利在线看| 久久国产欧美日韩精品| 亚洲人成精品久久久久久| 欧美成人免费网站| 91黄视频在线| 国产成人小视频| 免费精品99久久国产综合精品| 自拍偷自拍亚洲精品播放| 2021国产精品久久精品| 欧美久久久久久久久| 91欧美一区二区| 国产成人av电影免费在线观看| 视频在线在亚洲| 一区二区在线观看不卡| 欧美精彩视频一区二区三区| 日韩三级电影网址| 欧美性大战久久久久久久蜜臀| 99久精品国产| 99天天综合性| 成人免费视频国产在线观看| 狠狠色狠狠色综合| 久久精工是国产品牌吗| 午夜在线电影亚洲一区| 亚洲精品国产视频| 中文字幕在线观看不卡| 国产精品水嫩水嫩| 国产女同性恋一区二区| 久久久欧美精品sm网站| 秋霞午夜av一区二区三区| 久久精品一区八戒影视| 欧美一卡二卡三卡四卡| 欧美日韩成人综合| 欧美日韩综合不卡| 欧美视频中文一区二区三区在线观看| 99久久99久久综合| 99精品国产99久久久久久白柏| 白白色 亚洲乱淫| 成人av影视在线观看| 国产精品一二三在| 国精产品一区一区三区mba视频| 久久成人精品无人区| 精品亚洲aⅴ乱码一区二区三区| 美女视频黄a大片欧美| 另类小说视频一区二区| 激情文学综合网| 国产盗摄一区二区| av不卡在线播放| 欧美色成人综合| 91精品国产黑色紧身裤美女| 精品欧美一区二区久久| 久久蜜臀精品av| 国产精品久久久久久久久动漫| 亚洲免费观看高清| 午夜精品久久久久久不卡8050| 日本欧美加勒比视频| 国产资源在线一区| www.在线成人| 欧美日韩一区二区三区在线看| 91麻豆精品国产91久久久更新时间 | 国产精品国产三级国产普通话蜜臀| 国产日韩欧美精品一区| 亚洲欧美aⅴ...| 日韩精品91亚洲二区在线观看| 麻豆91精品91久久久的内涵| 国产成人精品www牛牛影视| 色综合中文字幕| 91精品国产综合久久香蕉麻豆| 久久久久久久一区| 亚洲最色的网站| 久久精品国产澳门| 不卡视频一二三四| 欧美丰满美乳xxx高潮www| 日韩欧美一级二级三级| 成人免费小视频| 麻豆精品新av中文字幕| www.欧美日韩| 91麻豆精品国产综合久久久久久 | 99久久久无码国产精品| 欧美精品自拍偷拍| 亚洲国产精品99久久久久久久久| 亚洲综合色丁香婷婷六月图片| 免费一区二区视频| 在线视频国内自拍亚洲视频| 日韩精品影音先锋| 一区二区三区在线免费视频| 激情欧美一区二区三区在线观看| 99精品久久免费看蜜臀剧情介绍| 91精品国产综合久久精品| 国产精品久久久久久亚洲伦 | 国产精品系列在线观看| 国产精品成人免费精品自在线观看| 欧美国产禁国产网站cc| 三级不卡在线观看| 91伊人久久大香线蕉| 精品人伦一区二区色婷婷| 亚洲777理论| av在线播放成人| 久久久www成人免费毛片麻豆| 亚洲国产人成综合网站| 成人动漫在线一区| 久久伊人蜜桃av一区二区| 天天影视网天天综合色在线播放| 懂色av噜噜一区二区三区av | 日韩欧美一区中文| 亚洲一区二区三区中文字幕在线| 国产精品一区专区| 日韩欧美国产不卡| 一区二区三区电影在线播| 国产成人免费视频网站高清观看视频| 欧美丰满少妇xxxxx高潮对白 | 99精品欧美一区二区蜜桃免费 | 欧美日韩卡一卡二| 亚洲精品成人天堂一二三| 成人av电影免费在线播放| 久久久一区二区| 极品美女销魂一区二区三区免费| 欧美日本在线播放| 亚洲国产精品精华液网站| 色香蕉久久蜜桃| 亚洲欧洲日韩综合一区二区| av激情亚洲男人天堂| 亚洲三级视频在线观看| 不卡视频免费播放| 国产精品福利一区二区三区| 国v精品久久久网| 国产精品无人区| 成人免费高清在线| 国产精品嫩草影院com| 丁香婷婷综合色啪| 国产精品欧美综合在线| 国产成人午夜视频| 中文字幕欧美激情一区| 高清在线成人网| 亚洲人精品午夜| 在线观看区一区二| 欧美亚一区二区| 国产欧美一区二区三区鸳鸯浴| 极品尤物av久久免费看| 久久夜色精品国产欧美乱极品| 国产一区欧美二区| 欧美激情中文字幕一区二区| caoporm超碰国产精品| 亚洲视频1区2区| 欧美性大战久久| 秋霞午夜鲁丝一区二区老狼| 亚洲精品在线观看网站| 不卡欧美aaaaa| 亚洲电影中文字幕在线观看| 91精品婷婷国产综合久久| 久久99精品国产91久久来源| 国产丝袜欧美中文另类| 99视频超级精品| 五月婷婷另类国产| 久久青草国产手机看片福利盒子| 国产酒店精品激情| 亚洲精品久久7777| 69av一区二区三区| 国产传媒欧美日韩成人| 亚洲自拍偷拍网站| 欧美电影免费提供在线观看| 国产东北露脸精品视频| 亚洲码国产岛国毛片在线|