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

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

?? abstractwizardformcontroller.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.servlet.mvc;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.WebUtils;

/**
 * Form controller for typical wizard-style workflows.
 *
 * <p>In contrast to classic forms, wizards have more than one form view page.
 * Therefore, there are various actions instead of one single submit action:
 * <ul>
 * <li>finish: trying to leave the wizard successfully, that is, perform its
 * final action, and thus requiring a valid state;
 * <li>cancel: leaving the wizard without performing its final action, and
 * thus without regard to the validity of its current state;
 * <li>page change: showing another wizard page, e.g. the next or previous
 * one, with regard to "dirty back" and "dirty forward".
 * </ul>
 *
 * <p>Finish and cancel actions can be triggered by request parameters, named
 * PARAM_FINISH ("_finish") and PARAM_CANCEL ("_cancel"), ignoring parameter
 * values to allow for HTML buttons. The target page for page changes can be
 * specified by PARAM_TARGET, appending the page number to the parameter name
 * (e.g. "_target1"). The action parameters are recognized when triggered by
 * image buttons too (via "_finish.x", "_abort.x", or "_target1.x").
 *
 * <p>The current page number will be stored in the session. It can also be
 * specified as request parameter PARAM_PAGE ("_page") in order to properly handle
 * usage of the back button in a browser: In this case, a submission will always
 * contain the correct page number, even if the user submitted from an old view.
 *
 * <p>The page can only be changed if it validates correctly, except if a
 * "dirty back" or "dirty forward" is allowed. At finish, all pages get
 * validated again to guarantee a consistent state.
 *
 * <p>Note that a validator's default validate method is not executed when using
 * this class! Rather, the {@link #validatePage} implementation should call
 * special <code>validateXXX</code> methods that the validator needs to provide,
 * validating certain pieces of the object. These can be combined to validate
 * the elements of individual pages.
 *
 * <p>Note: Page numbering starts with 0, to be able to pass an array
 * consisting of the corresponding view names to the "pages" bean property.
 *
 * @author Juergen Hoeller
 * @since 25.04.2003
 * @see #setPages
 * @see #validatePage
 * @see #processFinish
 * @see #processCancel
 */
public abstract class AbstractWizardFormController extends AbstractFormController {

	/**
	 * Parameter triggering the finish action.
	 * Can be called from any wizard page!
	 */
	public static final String PARAM_FINISH = "_finish";

	/**
	 * Parameter triggering the cancel action.
	 * Can be called from any wizard page!
	 */
	public static final String PARAM_CANCEL = "_cancel";

	/**
	 * Parameter specifying the target page,
	 * appending the page number to the name.
	 */
	public static final String PARAM_TARGET = "_target";

	/**
	 * Parameter specifying the current page as value. Not necessary on
	 * form pages, but allows to properly handle usage of the back button.
	 * @see #setPageAttribute
	 */
	public static final String PARAM_PAGE = "_page";


	private String[] pages;

	private String pageAttribute;

	private boolean allowDirtyBack = true;

	private boolean allowDirtyForward = false;


	/**
	 * Create a new AbstractWizardFormController.
	 * <p>"sessionForm" is automatically turned on, "validateOnBinding"
	 * turned off, and "cacheSeconds" set to 0 by the base class
	 * (-> no caching for all form controllers).
	 */
	public AbstractWizardFormController() {
		// AbstractFormController sets default cache seconds to 0.
		super();

		// Always needs session to keep data from all pages.
		setSessionForm(true);

		// Never validate everything on binding ->
		// wizards validate individual pages.
		setValidateOnBinding(false);
	}

	/**
	 * Set the wizard pages, i.e. the view names for the pages.
	 * The array index is interpreted as page number.
	 * @param pages view names for the pages
	 */
	public final void setPages(String[] pages) {
		if (pages == null || pages.length == 0)  {
			throw new IllegalArgumentException("No wizard pages defined");
		}
		this.pages = pages;
	}

	/**
	 * Return the wizard pages, i.e. the view names for the pages.
	 * The array index corresponds to the page number.
	 * <p>Note that a concrete wizard form controller might override
	 * {@link #getViewName(HttpServletRequest, Object, int)} to
	 * determine the view name for each page dynamically.
	 * @see #getViewName(javax.servlet.http.HttpServletRequest, Object, int)
	 */
	public final String[] getPages() {
		return this.pages;
	}

	/**
	 * Return the number of wizard pages.
	 * Useful to check whether the last page has been reached.
	 * <p>Note that a concrete wizard form controller might override
	 * {@link #getPageCount(HttpServletRequest, Object)} to determine
	 * the page count dynamically. The default implementation of that extended
	 * <code>getPageCount</code> variant returns the static page count as
	 * determined by this <code>getPageCount()</code> method.
	 * @see #getPageCount(javax.servlet.http.HttpServletRequest, Object)
	 */
	protected final int getPageCount() {
		return this.pages.length;
	}

	/**
	 * Set the name of the page attribute in the model, containing
	 * an Integer with the current page number.
	 * <p>This will be necessary for single views rendering multiple view pages.
	 * It also allows for specifying the optional "_page" parameter.
	 * @param pageAttribute name of the page attribute
	 * @see #PARAM_PAGE
	 */
	public final void setPageAttribute(String pageAttribute) {
		this.pageAttribute = pageAttribute;
	}

	/**
	 * Return the name of the page attribute in the model.
	 */
	public final String getPageAttribute() {
		return this.pageAttribute;
	}

	/**
	 * Set if "dirty back" is allowed, that is, if moving to a former wizard
	 * page is allowed in case of validation errors for the current page.
	 * @param allowDirtyBack if "dirty back" is allowed
	 */
	public final void setAllowDirtyBack(boolean allowDirtyBack) {
		this.allowDirtyBack = allowDirtyBack;
	}

	/**
	 * Return whether "dirty back" is allowed.
	 */
	public final boolean isAllowDirtyBack() {
		return this.allowDirtyBack;
	}

	/**
	 * Set if "dirty forward" is allowed, that is, if moving to a later wizard
	 * page is allowed in case of validation errors for the current page.
	 * @param allowDirtyForward if "dirty forward" is allowed
	 */
	public final void setAllowDirtyForward(boolean allowDirtyForward) {
		this.allowDirtyForward = allowDirtyForward;
	}

	/**
	 * Return whether "dirty forward" is allowed.
	 */
	public final boolean isAllowDirtyForward() {
		return this.allowDirtyForward;
	}


	/**
	 * Calls page-specific onBindAndValidate method.
	 */
	protected final void onBindAndValidate(HttpServletRequest request, Object command, BindException errors)
	    throws Exception {

		onBindAndValidate(request, command, errors, getCurrentPage(request));
	}

	/**
	 * Callback for custom post-processing in terms of binding and validation.
	 * Called on each submit, after standard binding but before page-specific
	 * validation of this wizard form controller.
	 * <p>Note: AbstractWizardFormController does not perform standand
	 * validation on binding but rather applies page-specific validation
	 * on processing the form submission.
	 * @param request current HTTP request
	 * @param command bound command
	 * @param errors Errors instance for additional custom validation
	 * @param page current wizard page
	 * @throws Exception in case of invalid state or arguments
	 * @see #bindAndValidate
	 * @see #processFormSubmission
	 * @see org.springframework.validation.Errors
	 */
	protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors, int page)
	    throws Exception {
	}

	/**
	 * Consider an explicit finish or cancel request as a form submission too.
	 * @see #isFinishRequest(javax.servlet.http.HttpServletRequest)
	 * @see #isCancelRequest(javax.servlet.http.HttpServletRequest)
	 */
	protected boolean isFormSubmission(HttpServletRequest request) {
		return super.isFormSubmission(request) || isFinishRequest(request) || isCancelRequest(request);
	}

	/**
	 * Calls page-specific referenceData method.
	 */
	protected final Map referenceData(HttpServletRequest request, Object command, Errors errors)
	    throws Exception {

		return referenceData(request, command, errors, getCurrentPage(request));
	}

	/**
	 * Create a reference data map for the given request, consisting of
	 * bean name/bean instance pairs as expected by ModelAndView.
	 * <p>The default implementation delegates to referenceData(HttpServletRequest, int).
	 * Subclasses can override this to set reference data used in the view.
	 * @param request current HTTP request
	 * @param command form object with request parameters bound onto it
	 * @param errors validation errors holder
	 * @param page current wizard page
	 * @return a Map with reference data entries, or <code>null</code> if none
	 * @throws Exception in case of invalid state or arguments
	 * @see #referenceData(HttpServletRequest, int)
	 * @see ModelAndView
	 */
	protected Map referenceData(HttpServletRequest request, Object command, Errors errors, int page)
	    throws Exception {

		return referenceData(request, page);
	}

	/**
	 * Create a reference data map for the given request, consisting of
	 * bean name/bean instance pairs as expected by ModelAndView.
	 * <p>The default implementation returns <code>null</code>.
	 * Subclasses can override this to set reference data used in the view.
	 * @param request current HTTP request
	 * @param page current wizard page
	 * @return a Map with reference data entries, or <code>null</code> if none
	 * @throws Exception in case of invalid state or arguments
	 * @see ModelAndView
	 */
	protected Map referenceData(HttpServletRequest request, int page) throws Exception {
		return null;
	}


	/**
	 * Show the first page as form view.
	 * <p>This can be overridden in subclasses, e.g. to prepare wizard-specific
	 * error views in case of an Exception.
	 */
	protected ModelAndView showForm(
			HttpServletRequest request, HttpServletResponse response, BindException errors)
	    throws Exception {

		return showPage(request, errors, getInitialPage(request, errors.getTarget()));
	}

	/**
	 * Prepare the form model and view, including reference and error data,
	 * for the given page. Can be used in {@link #processFinish} implementations,
	 * to show the corresponding page in case of validation errors.
	 * @param request current HTTP request
	 * @param errors validation errors holder
	 * @param page number of page to show
	 * @return the prepared form view
	 * @throws Exception in case of invalid state or arguments
	 */
	protected final ModelAndView showPage(HttpServletRequest request, BindException errors, int page)
	    throws Exception {

		if (page >= 0 && page < getPageCount(request, errors.getTarget())) {
			if (logger.isDebugEnabled()) {
				logger.debug("Showing wizard page " + page + " for form bean '" + getCommandName() + "'");
			}

			// Set page session attribute, expose overriding request attribute.
			Integer pageInteger = new Integer(page);
			String pageAttrName = getPageSessionAttributeName(request);
			if (isSessionForm()) {
				if (logger.isDebugEnabled()) {
					logger.debug("Setting page session attribute [" + pageAttrName + "] to: " + pageInteger);
				}
				request.getSession().setAttribute(pageAttrName, pageInteger);
			}
			request.setAttribute(pageAttrName, pageInteger);

			// Set page request attribute for evaluation by views.
			Map controlModel = new HashMap();
			if (this.pageAttribute != null) {
				controlModel.put(this.pageAttribute, new Integer(page));
			}
			String viewName = getViewName(request, errors.getTarget(), page);
			return showForm(request, errors, viewName, controlModel);
		}

		else {
			throw new ServletException("Invalid wizard page number: " + page);
		}
	}

	/**
	 * Return the page count for this wizard form controller.
	 * The default implementation delegates to {@link #getPageCount()}.
	 * <p>Can be overridden to dynamically adapt the page count.
	 * @param request current HTTP request
	 * @param command the command object as returned by formBackingObject
	 * @return the current page count
	 * @see #getPageCount
	 */
	protected int getPageCount(HttpServletRequest request, Object command) {
		return getPageCount();
	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
福利电影一区二区| 一区二区在线观看不卡| 成人黄色电影在线| 日本不卡的三区四区五区| 日韩欧美在线综合网| 亚洲国产精品一区二区久久| 国产成人自拍网| 久久久久久免费毛片精品| 蜜桃视频在线观看一区| 日韩一区二区免费在线观看| 国产精品 欧美精品| 91精品在线观看入口| 26uuu国产电影一区二区| 三级欧美在线一区| 亚洲人吸女人奶水| 久久久不卡网国产精品一区| 欧美日韩高清一区二区不卡| 99re视频精品| 成人免费高清在线观看| 欧美aaa在线| 香蕉成人啪国产精品视频综合网| 国产精品久久久久婷婷| 久久久久一区二区三区四区| 91精品国产欧美一区二区18| 在线观看视频欧美| www.亚洲人| 成人午夜免费av| 国产精品一区二区男女羞羞无遮挡| 婷婷综合五月天| 亚洲一二三区视频在线观看| 亚洲特级片在线| 亚洲欧洲一区二区三区| 国产精品久久久久9999吃药| 国产日韩精品久久久| 国产亚洲婷婷免费| 久久蜜臀中文字幕| 久久久99久久精品欧美| 久久久久久久综合| 久久久久久久久97黄色工厂| 久久久久久久久久久99999| 精品国产乱码久久久久久浪潮| 欧美一区二区观看视频| 欧美人与z0zoxxxx视频| 777久久久精品| 日韩精品自拍偷拍| 精品美女一区二区三区| 色哟哟国产精品免费观看| 国产福利视频一区二区三区| 国产精品自在在线| 国产高清一区日本| 成人精品一区二区三区四区| 成人福利电影精品一区二区在线观看| 国产成人在线视频免费播放| 丰满放荡岳乱妇91ww| 不卡视频一二三四| 91九色02白丝porn| 欧美日韩国产在线播放网站| 欧美一区二区福利视频| 日韩精品一区国产麻豆| 精品国产三级a在线观看| 精品国产乱码久久久久久牛牛| 国产午夜精品一区二区三区视频| 6080日韩午夜伦伦午夜伦| 欧美亚洲高清一区| 91麻豆福利精品推荐| 成人黄色一级视频| 99这里只有精品| 日本精品裸体写真集在线观看| 色综合网色综合| 久久综合九色欧美综合狠狠| 九九九久久久精品| 国产白丝网站精品污在线入口| 成人高清免费在线播放| 日本高清视频一区二区| 欧美一级在线观看| 国产精品久久久久久久久免费丝袜| 亚洲精品亚洲人成人网| 天天影视色香欲综合网老头| 亚洲影院久久精品| 免费欧美在线视频| 成年人国产精品| 69堂亚洲精品首页| 中文欧美字幕免费| 午夜精品福利在线| 成人性色生活片免费看爆迷你毛片| 在线观看91视频| 欧美精品一区二区久久久| 亚洲人成7777| 日韩福利电影在线| 爽好多水快深点欧美视频| 全部av―极品视觉盛宴亚洲| 成人一区二区在线观看| 欧美日韩一区久久| 中国av一区二区三区| 天堂va蜜桃一区二区三区漫画版 | 国产精品免费视频一区| 性感美女极品91精品| 成人av在线资源网站| 91精品国产色综合久久| 亚洲精品视频在线| 国产一区福利在线| 欧美日韩精品三区| 中文字幕制服丝袜一区二区三区| 美女精品一区二区| 在线中文字幕不卡| 中文字幕中文字幕在线一区 | 国产成人在线视频免费播放| 91麻豆精品国产91久久久久久 | 精品奇米国产一区二区三区| 国产精品久久国产精麻豆99网站| 天堂在线亚洲视频| 午夜精品久久一牛影视| 91在线观看视频| 国产精品私人影院| 成人听书哪个软件好| 亚洲精品在线观看视频| 天天综合网 天天综合色| 91色|porny| 中文字幕在线播放不卡一区| 成人激情小说网站| 亚洲国产一区二区三区青草影视| 蜜桃一区二区三区四区| 91精彩视频在线观看| 国产精品美女一区二区在线观看| 亚洲一区自拍偷拍| 狠狠v欧美v日韩v亚洲ⅴ| 欧美精品久久天天躁| 亚洲一区二区在线免费看| 色综合天天综合| 亚洲美女免费在线| 成人动漫视频在线| 国产精品少妇自拍| 国产成人av电影在线播放| 久久亚洲捆绑美女| 国产在线精品视频| 久久综合色综合88| 国产精品中文有码| 久久久久国产精品麻豆ai换脸 | 亚洲国产日日夜夜| 色噜噜偷拍精品综合在线| 最新久久zyz资源站| 99精品视频一区二区| 亚洲欧美一区二区不卡| 色成年激情久久综合| 一区二区免费在线| 成人午夜私人影院| 亚洲欧美偷拍卡通变态| 日本二三区不卡| 午夜国产精品影院在线观看| 欧美日韩精品系列| 久久se这里有精品| 国产日韩影视精品| 不卡的看片网站| 亚洲黄色尤物视频| 欧美日韩久久久| 久久激情五月激情| 久久精品欧美一区二区三区不卡| 成人一道本在线| 亚洲欧美偷拍三级| 欧美日韩国产电影| 久热成人在线视频| 中文字幕久久午夜不卡| 97成人超碰视| 视频在线观看一区二区三区| 欧美第一区第二区| 不卡一区中文字幕| 精品乱码亚洲一区二区不卡| 国产精品一区二区x88av| 国产精品久久精品日日| 欧美日韩国产高清一区| 国产一区二区按摩在线观看| 亚洲女女做受ⅹxx高潮| 91精品麻豆日日躁夜夜躁| 国产黄色91视频| 国产69精品久久久久毛片| 91精品国产入口在线| 亚洲图片一区二区| 在线视频国内一区二区| 欧美日韩中字一区| 欧美精品九九99久久| 欧美一级二级在线观看| 欧美一区二区三区婷婷月色| 日韩精品资源二区在线| 国产亚洲精品中文字幕| 中文字幕日韩av资源站| 欧美激情一二三区| 99久久婷婷国产综合精品电影| 欧美一区二区国产| 国产.精品.日韩.另类.中文.在线.播放 | 日本欧美一区二区在线观看| 久久久久久97三级| 欧美日韩激情一区二区三区| 国产精品69久久久久水密桃| 亚洲午夜国产一区99re久久| 久久久久久久综合色一本| 欧美女孩性生活视频| av电影天堂一区二区在线观看| 另类小说图片综合网| 亚洲综合激情网| 国产精品黄色在线观看|