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

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

?? basecommandcontroller.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
 * Copyright 2002-2007 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.portlet.mvc;

import javax.portlet.ActionRequest;
import javax.portlet.PortletException;
import javax.portlet.PortletRequest;
import javax.portlet.PortletSession;
import javax.portlet.RenderRequest;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.validation.BindException;
import org.springframework.validation.BindingErrorProcessor;
import org.springframework.validation.MessageCodesResolver;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.portlet.bind.PortletRequestDataBinder;
import org.springframework.web.portlet.context.PortletWebRequest;
import org.springframework.web.portlet.handler.PortletSessionRequiredException;

/**
 * <p>Controller implementation which creates an object (the command object) on
 * receipt of a request and attempts to populate this object with request parameters.</p>
 *
 * <p>This controller is the base for all controllers wishing to populate
 * JavaBeans based on request parameters, validate the content of such
 * JavaBeans using {@link Validator Validators} and use custom editors (in the form of
 * {@link java.beans.PropertyEditor PropertyEditors}) to transform 
 * objects into strings and vice versa, for example. Three notions are mentioned here:</p>
 *
 * <p><b>Command class:</b><br>
 * An instance of the command class will be created for each request and populated
 * with request parameters. A command class can basically be any Java class; the only
 * requirement is a no-arg constructor. The command class should preferably be a
 * JavaBean in order to be able to populate bean properties with request parameters.</p>
 *
 * <p><b>Populating using request parameters and PropertyEditors:</b><br>
 * Upon receiving a request, any BaseCommandController will attempt to fill the
 * command object using the request parameters. This is done using the typical
 * and well-known JavaBeans property notation. When a request parameter named
 * <code>'firstName'</code> exists, the framework will attempt to call 
 * <code>setFirstName([value])</code> passing the value of the parameter. Nested properties
 * are of course supported. For instance a parameter named <code>'address.city'</code>
 * will result in a <code>getAddress().setCity([value])</code> call on the
 * command class.</p>
 *
 * <p>It's important to realize that you are not limited to String arguments in
 * your JavaBeans. Using the PropertyEditor-notion as supplied by the
 * java.beans package, you will be able to transform Strings to Objects and
 * the other way around. For instance <code>setLocale(Locale loc)</code> is
 * perfectly possible for a request parameter named <code>locale</code> having
 * a value of <code>en</code>, as long as you register the appropriate
 * PropertyEditor in the Controller (see {@link #initBinder initBinder()}
 * for more information on that matter).</p>
 *
 * <p><b>Validators:</b>
 * After the controller has successfully populated the command object with
 * parameters from the request, it will use any configured validators to
 * validate the object. Validation results will be put in a
 * {@link org.springframework.validation.Errors Errors} object which can be
 * used in a View to render any input problems.</p>
 *
 * <p><b><a name="workflow">Workflow
 * (<a href="AbstractController.html#workflow">and that defined by superclass</a>):</b><br>
 * Since this class is an abstract base class for more specific implementation,
 * it does not override the <code>handleRequestInternal()</code> methods and also has no
 * actual workflow. Implementing classes like
 * {@link AbstractFormController AbstractFormController},
 * {@link AbstractCommandController AbstractCommandController},
 * {@link SimpleFormController SimpleFormController} and
 * {@link AbstractWizardFormController AbstractWizardFormController}
 * provide actual functionality and workflow.
 * More information on workflow performed by superclasses can be found
 * <a href="AbstractController.html#workflow">here</a>.</p>
 *
 * <p><b><a name="config">Exposed configuration properties</a>
 * (<a href="AbstractController.html#config">and those defined by superclass</a>):</b><br>
 * <table border="1">
 *  <tr>
 *      <td><b>name</b></th>
 *      <td><b>default</b></td>
 *      <td><b>description</b></td>
 *  </tr>
 *  <tr>
 *      <td>commandName</td>
 *      <td>command</td>
 *      <td>the name to use when binding the instantiated command class
 *          to the request</td>
 *  </tr>
 *  <tr>
 *      <td>commandClass</td>
 *      <td><i>null</i></td>
 *      <td>the class to use upon receiving a request and which to fill
 *          using the request parameters. What object is used and whether
 *          or not it should be created is defined by extending classes
 *          and their configuration properties and methods.</td>
 *  </tr>
 *  <tr>
 *      <td>validators</td>
 *      <td><i>null</i></td>
 *      <td>Array of Validator beans. The validator will be called at appropriate
 *          places in the workflow of subclasses (have a look at those for more info)
 *          to validate the command object.</td>
 *  </tr>
 *  <tr>
 *      <td>validator</td>
 *      <td><i>null</i></td>
 *      <td>Short-form property for setting only one Validator bean (usually passed in
 *          using a &lt;ref bean="beanId"/&gt; property.</td>
 *  </tr>
 *  <tr>
 *      <td>validateOnBinding</td>
 *      <td>true</td>
 *      <td>Indicates whether or not to validate the command object after the
 *          object has been populated with request parameters.</td>
 *  </tr>
 * </table>
 * </p>
 *
 * <p>Thanks to Rainer Schmitz and Nick Lothian for their suggestions!
 *
 * @author Juergen Hoeller
 * @author John A. Lewis
 * @since 2.0
 */
public abstract class BaseCommandController extends AbstractController {

	/**
	 * Unlike the Servlet version of these classes, we have to deal with the
	 * two-phase nature of the porlet request. To do this, we need to pass
	 * forward the command object and the bind/validation errors that occured
	 * on the command object from the action phase to the render phase.
	 * The only direct way to pass things forward and preserve them for each
	 * render request is through render parameters, but these are limited to
	 * String objects and we need to pass more complicated objects. The only
	 * other way to do this is in the session. The bad thing about using the
	 * session is that we have no way of knowing when we are done re-rendering
	 * the request and so we don't know when we can remove the objects from
	 * the session. So we will end up polluting the session with old objects
	 * when we finally leave the render of this controller and move on to 
	 * somthing else. To minimize the pollution, we will use a static string
	 * value as the session attribute name. At least this way we are only ever
	 * leaving one orphaned set behind. The methods that return these names
	 * can be overridden if you want to use a different method, but be aware
	 * of the session pollution that may occur.
	 */
	private static final String RENDER_COMMAND_SESSION_ATTRIBUTE = 
			"org.springframework.web.portlet.mvc.RenderCommand";

	private static final String RENDER_ERRORS_SESSION_ATTRIBUTE =
			"org.springframework.web.portlet.mvc.RenderErrors";

	public static final String DEFAULT_COMMAND_NAME = "command";


	private String commandName = DEFAULT_COMMAND_NAME;
	
	private Class commandClass;
	
	private Validator[] validators;
	
	private boolean validateOnBinding = true;
	
	private MessageCodesResolver messageCodesResolver;

	private BindingErrorProcessor bindingErrorProcessor;

	private PropertyEditorRegistrar[] propertyEditorRegistrars;

	private WebBindingInitializer webBindingInitializer;


	/**
	 * Set the name of the command in the model.
	 * The command object will be included in the model under this name.
	 */
	public final void setCommandName(String commandName) {
		this.commandName = commandName;
	}

	/**
	 * Return the name of the command in the model.
	 */
	public final String getCommandName() {
		return this.commandName;
	}

	/**
	 * Set the command class for this controller.
	 * An instance of this class gets populated and validated on each request.
	 */
	public final void setCommandClass(Class commandClass) {
		this.commandClass = commandClass;
	}

	/**
	 * Return the command class for this controller.
	 */
	public final Class getCommandClass() {
		return this.commandClass;
	}

	/**
	 * Set the primary Validator for this controller. The Validator
	 * must support the specified command class. If there are one
	 * or more existing validators set already when this method is
	 * called, only the specified validator will be kept. Use
	 * {@link #setValidators(Validator[])} to set multiple validators.
	 */
	public final void setValidator(Validator validator) {
		this.validators = new Validator[] {validator};
	}

	/**
	 * @return the primary Validator for this controller.
	 */
	public final Validator getValidator() {
		return (this.validators != null && this.validators.length > 0 ? this.validators[0] : null);
	}

	/**
	 * Set the Validators for this controller.
	 * The Validator must support the specified command class.
	 */
	public final void setValidators(Validator[] validators) {
		this.validators = validators;
	}

	/**
	 * Return the Validators for this controller.
	 */
	public final Validator[] getValidators() {
		return this.validators;
	}

	/**
	 * Set if the Validator should get applied when binding.
	 */
	public final void setValidateOnBinding(boolean validateOnBinding) {
		this.validateOnBinding = validateOnBinding;
	}

	/**
	 * Return if the Validator should get applied when binding.
	 */
	public final boolean isValidateOnBinding() {
		return this.validateOnBinding;
	}

	/**
	 * Set the strategy to use for resolving errors into message codes.
	 * Applies the given strategy to all data binders used by this controller.
	 * <p>Default is null, i.e. using the default strategy of the data binder.
	 * @see #createBinder
	 * @see org.springframework.validation.DataBinder#setMessageCodesResolver
	 */
	public final void setMessageCodesResolver(MessageCodesResolver messageCodesResolver) {
		this.messageCodesResolver = messageCodesResolver;
	}

	/**
	 * Return the strategy to use for resolving errors into message codes (if any).
	 */
	public final MessageCodesResolver getMessageCodesResolver() {
		return this.messageCodesResolver;
	}

	/**
	 * Set the strategy to use for processing binding errors, that is,
	 * required field errors and <code>PropertyAccessException</code>s.
	 * <p>Default is <code>null</code>, i.e. using the default strategy of
	 * the data binder.
	 * @see #createBinder
	 * @see org.springframework.validation.DataBinder#setBindingErrorProcessor
	 */
	public final void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor) {
		this.bindingErrorProcessor = bindingErrorProcessor;
	}

	/**
	 * Return the strategy to use for processing binding errors (if any).
	 */
	public final BindingErrorProcessor getBindingErrorProcessor() {
		return this.bindingErrorProcessor;
	}

	/**
	 * Specify a single PropertyEditorRegistrar to be applied
	 * to every DataBinder that this controller uses.
	 * <p>Allows for factoring out the registration of PropertyEditors
	 * to separate objects, as an alternative to <code>initBinder</code>.
	 * @see #initBinder
	 */
	public final void setPropertyEditorRegistrar(PropertyEditorRegistrar propertyEditorRegistrar) {
		this.propertyEditorRegistrars = new PropertyEditorRegistrar[] {propertyEditorRegistrar};
	}

	/**
	 * Specify one or more PropertyEditorRegistrars to be applied
	 * to every DataBinder that this controller uses.
	 * <p>Allows for factoring out the registration of PropertyEditors
	 * to separate objects, as alternative to <code>initBinder</code>.
	 * @see #initBinder
	 */
	public final void setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars) {
		this.propertyEditorRegistrars = propertyEditorRegistrars;
	}

	/**
	 * Return the PropertyEditorRegistrars (if any) to be applied
	 * to every DataBinder that this controller uses.
	 */
	public final PropertyEditorRegistrar[] getPropertyEditorRegistrars() {
		return this.propertyEditorRegistrars;
	}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情小说亚洲一区| 欧美在线视频你懂得| 综合激情成人伊人| 在线观看视频一区| 极品美女销魂一区二区三区| 亚洲综合丝袜美腿| 日韩你懂的在线播放| 色综合久久久久综合体| 国产麻豆精品theporn| 亚洲在线免费播放| 国产精品久久久久影院| 欧美一级免费观看| 欧洲精品一区二区三区在线观看| 国产一区二区三区综合| 亚洲福利一区二区三区| 国产精品毛片无遮挡高清| 日韩精品一区国产麻豆| 欧美午夜精品一区二区三区| 成人av在线一区二区三区| 老司机精品视频在线| 亚洲成人黄色小说| 亚洲乱码国产乱码精品精可以看| 国产亚洲va综合人人澡精品| 日韩欧美一卡二卡| 777午夜精品免费视频| 欧洲亚洲精品在线| 99re热视频这里只精品| 成人深夜福利app| 韩国欧美国产一区| 久久精品噜噜噜成人88aⅴ| 亚洲r级在线视频| 亚洲激情图片小说视频| 亚洲婷婷综合久久一本伊一区| 国产亚洲一本大道中文在线| 精品捆绑美女sm三区| 欧美一区二区三区影视| 欧美精品 国产精品| 欧美日韩一区二区三区四区五区| 日本黄色一区二区| 在线观看三级视频欧美| 一本色道久久综合狠狠躁的推荐| 成人黄色片在线观看| 福利电影一区二区| 国产999精品久久| 中文字幕在线不卡一区| 国产精品卡一卡二卡三| 国产欧美视频一区二区| 国产亚洲精品超碰| 国产精品国产三级国产有无不卡| 91视频.com| 日本精品一区二区三区四区的功能| 91女厕偷拍女厕偷拍高清| 91天堂素人约啪| 在线亚洲+欧美+日本专区| 色老汉一区二区三区| 91麻豆精品一区二区三区| 色婷婷国产精品| 欧美三级蜜桃2在线观看| 欧美色网站导航| 欧美日本一区二区在线观看| 欧美丰满少妇xxxxx高潮对白| 日韩一区二区在线播放| 国产亚洲一区字幕| 国产精品久久久久久妇女6080| 国产精品久久久一区麻豆最新章节| 国产精品久久久久aaaa| 亚洲一区二区三区国产| 婷婷综合在线观看| 日韩精品亚洲一区二区三区免费| 久久激情五月婷婷| 成人免费va视频| 日本高清免费不卡视频| 欧美一区二区大片| 欧美精彩视频一区二区三区| 亚洲激情图片小说视频| 免费在线观看一区二区三区| 国产91在线观看丝袜| 99久久精品国产导航| 欧美私模裸体表演在线观看| 日韩美女视频一区二区在线观看| 国产精品免费人成网站| 污片在线观看一区二区| 国产一区二区视频在线播放| 91福利视频在线| 欧美成人一区二区三区| 亚洲少妇30p| 三级亚洲高清视频| 春色校园综合激情亚洲| 欧美日韩五月天| 中文字幕av在线一区二区三区| 亚洲成人7777| 成人综合婷婷国产精品久久| 56国语精品自产拍在线观看| 国产色婷婷亚洲99精品小说| 午夜精品久久久久| 成人动漫一区二区在线| 91精品欧美福利在线观看| 久久久久久久精| 日韩精品色哟哟| 99视频一区二区三区| 欧美一区二区三区啪啪| 中文字幕一区二区视频| 久久精品国产亚洲a| 成人开心网精品视频| 日韩欧美精品在线视频| 一区二区在线观看视频| 国产一区二区在线影院| 欧美一区二区三区人| 一区二区三区在线视频播放| 国产中文一区二区三区| 911精品国产一区二区在线| 国产精品成人在线观看| 国产一区91精品张津瑜| 日韩欧美亚洲一区二区| 亚洲高清不卡在线观看| eeuss鲁片一区二区三区在线看| 日韩视频在线观看一区二区| 亚洲精品成a人| 91麻豆国产福利精品| 国产欧美一区二区精品婷婷| av动漫一区二区| 91蜜桃传媒精品久久久一区二区| www国产精品av| 日韩中文字幕av电影| 在线精品视频免费观看| 1000部国产精品成人观看| 国产电影一区二区三区| 久久综合狠狠综合| 男人的天堂亚洲一区| 欧美在线免费视屏| 亚洲色图在线播放| 99久久精品费精品国产一区二区| 国产精品视频看| 国产美女主播视频一区| 精品精品国产高清a毛片牛牛| 日韩福利视频网| 欧美日韩综合一区| 亚洲国产另类精品专区| 欧美色爱综合网| 婷婷综合五月天| 欧美一区午夜视频在线观看| 亚洲成人av免费| 欧美一区在线视频| 黄网站免费久久| 国产午夜三级一区二区三| 国产成人av电影| 国产欧美日韩激情| 成人性生交大片免费看中文网站| 国产剧情一区二区三区| 高清日韩电视剧大全免费| 欧美色成人综合| 日本成人中文字幕| 欧美精品日韩精品| 毛片av中文字幕一区二区| 精品国产91亚洲一区二区三区婷婷| 国产在线精品一区二区夜色| 久久精品视频网| 91丨九色丨尤物| 亚洲国产精品视频| 91精品国产色综合久久久蜜香臀| 久久福利资源站| gogo大胆日本视频一区| 亚洲一二三区在线观看| 欧美老人xxxx18| 另类欧美日韩国产在线| 中文字幕巨乱亚洲| 日本道精品一区二区三区| 日韩电影在线一区二区| 337p粉嫩大胆噜噜噜噜噜91av| 粉嫩av一区二区三区在线播放| 欧美色网站导航| 国产麻豆午夜三级精品| 亚洲免费观看高清完整| 在线播放欧美女士性生活| 国产精品原创巨作av| 中文字幕一区二区在线观看| 欧美影视一区在线| 国产一区二区三区最好精华液 | 成人免费视频视频| 国产精品美女一区二区在线观看| 欧美亚洲一区三区| 人人精品人人爱| 国产精品欧美精品| 在线电影欧美成精品| 国产高清久久久| 亚洲h在线观看| 国产精品色眯眯| 欧美精品久久久久久久多人混战| 国产精品亚洲一区二区三区妖精 | 国产视频在线观看一区二区三区| 欧洲激情一区二区| 国产成人av一区二区三区在线 | 国产一区不卡在线| 亚洲午夜在线观看视频在线| 精品国产三级a在线观看| 91国内精品野花午夜精品 | 国产成人av福利| 蓝色福利精品导航| 一区二区成人在线视频| 国产亚洲欧美中文|