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

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

?? lazyvalidatorform.java

?? struts的源代碼
?? JAVA
字號:
/*
 * $Id: LazyValidatorForm.java 56698 2004-11-05 21:11:41Z niallp $ 
 *
 * Copyright 2004 The Apache Software Foundation.
 *
 * 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.apache.struts.validator;

import java.util.Map;
import java.util.List;
import org.apache.commons.beanutils.DynaBean;
import org.apache.commons.beanutils.LazyDynaBean;
import org.apache.commons.beanutils.LazyDynaMap;

/**
 * <p>Struts <i>Lazy</i> <code>ActionForm</code> which <i>wraps</i> a <code>LazyDynaBean</code>.</p>
 *
 * <p>There isn't really that much to this implementation as most of the <i>lazy</i> behaviour is in 
 *    <code>LazyDynaBean</code> and <i>wrapping</i> the <code>LazyDynaBean<code> is handled in the parent
 *    <code>BeanValidatorForm</code>. The only thing it really does is populate <i>indexed</i> properties
 *    which are a <code>List<code> type with a <code>LazyDynaBean<code> in the <code>get(name, index)</code>
 *    method.</p>
 *
 * <p><i>Lazy</i> DynaBeans provide several types of <i>lazy</i> behaviour:</p>
 * <ul>
 *     <li><b><i>lazy</i> property addition</b> - properties which do not exist
 *         are automatically added.</li>
 *     <li><b><i>lazy</i> List facilities</b> - automatically <i>grows</i> a <code>List</code> or
 *         <code>Array</code> to accomodate the index value being set.</li>
 *     <li><b><i>lazy</i> List creation</b> - automatic creation of a <code>List</code>
 *         or <code>Array</code> for <i>indexed</i> properties, if it doesn't exist.</li>
 *     <li><b><i>lazy</i> Map creation</b> - automatic creation of a <code>Map</code>
 *         for <i>mapped</i> properties, if it doesn't exist.</li>
 * </ul>
 *
 * <p>Using this <i>lazy</i> <code>ActionForm</code> means that you don't have to define the ActionForm's 
 *    properties in the <code>struts-config.xml</code>. However, a word of warning, everything in the 
 *    Request gets populated into this <code>ActionForm</code> circumventing the normal <i>firewall</i>
 *    function of Struts forms. Therefore you should only <i>take out</i> of this form properties you expect
 *    to be there rather than blindly populating all the properties into the business tier.</p>
 *
 * <p>Having said that it is not necessary to pre-define properties in the <code>struts-config.xml</code>, it is
 *    useful to sometimes do so for <i>mapped</i> or <i>indexed</i> properties. For example, if you want to use
 *    a different <code>Map<code> implementation from the default <code>HashMap</code> or an array for indexed
 *    properties, rather than the default <code>List</code> type:</p>
 * 
 * <pre><code>
 *   &lt;form-bean name="myForm" type="org.apache.struts.validator.LazyValidatorForm"&gt;
 *     &lt;form-property name="myMap" type="java.util.TreeMap" /&gt;
 *     &lt;form-property name="myBeans" type="org.apache.commons.beanutils.LazyDynaBean[]" /&gt;
 *   &lt;/form-bean&gt;
 * </code></pre>
 *
 * <p>Another reason for defining <i>indexed</i> properties in the <code>struts-config.xml</code> is that
 *    if you are validating indexed properties using the Validator and none are submitted then the indexed
 *    property will be <code>null</code> which causes validator to fail. Pre-defining them in the
 *    <code>struts-config.xml</code> will result in a zero-length indexed property (array or List) being
 *    instantiated, avoiding an issue with validator in that circumstance.</p>
 *
 * <p>This implementation validates using the ActionForm <i>name</i>. If you require a version that
 *    validates according to the <i>path</i> then it can be easily created in the following manner:</p>
 *
 *  <pre><code>
 *    public class MyLazyForm extends LazyValidatorForm {
 *
 *        public MyLazyForm () {
 *            super();
 *            setPathValidation(true);
 *        }
 *
 *    }
 * </code></pre>
 *
 * <p>Rather than using this class, another alternative is to either use a <code>LazyDynaBean</code> or
 *    custom version of <code>LazyDynaBean</code> directly. Struts now automatically <i>wraps</i> objects
 *    which are not <code>ActionForms</code> in a <code>BeanValidatorForm</code>. For example:</p>
 * 
 * <pre><code>
 *   &lt;form-bean name="myForm" type="org.apache.commons.beanutils.LazyDynaBean"&gt;
 *     &lt;form-property name="myBeans" type="org.apache.commons.beanutils.LazyDynaBean[]" /&gt;
 *   &lt;/form-bean&gt;
 * </code></pre>
 *
 * @see <a href="http://jakarta.apache.org/commons/beanutils/apidocs/org/apache/commons/beanutils/package-summary.html#dynamic.lazy">Commons BeanUtils JavaDoc</a>
 * @since Struts 1.2.6
 * @version $Rev: 56698 $ $Date: 2004-11-05 21:11:41 +0000 (Fri, 05 Nov 2004) $ 
 */
public class LazyValidatorForm extends BeanValidatorForm {

    // ------------------- Constructors ----------------------------------

    /**
     * Default Constructor which creates a <code>LazyDynaBean</code> to <i>back</i>
     * this form.
     */
    public LazyValidatorForm() {
        super(new LazyDynaBean());
    }

    /**
     */
    public LazyValidatorForm(DynaBean bean) {
        super(bean);
    }

    // ------------------- DynaBean methods ----------------------------------

   /**
    * <p>Return an indexed property value.</p>
    *
    * <p>If the "indexed" property is a <code>List</code> type then
    *    any missing values are populated with a bean (created in
    *    the <code>newIndexedBean(name)</code> method - in this
    *    implementation this is a <code>LazyDynaBean</code> type.</p>
    */
    public Object get(String name, int index) {

        int size = size(name);


        // Get the indexed property
        Object value = dynaBean.get(name, index);

        // Create missing beans for Lists
        if (value == null) {
            Object indexedValue = dynaBean.get(name);
            if (List.class.isAssignableFrom(indexedValue.getClass())) {
                for (int i = size; i <= index; i++) {
                    value = newIndexedBean(name);
                    set(name, i, value);
                }
            }
        }

        return value;

    }

    // ------------------- Public methods ----------------------------------

   /**
    * <p>Return the <code>Map</code> containing the property values.</p>
    *
    * <p>Provided so that properties can be access using JSTL.</p>
    */
    public Map getMap() {
        return ((LazyDynaBean)dynaBean).getMap();
    }

    // ------------------- Protected methods ----------------------------------

   /**
    * <p>Creates new <code>DynaBean</code> instances to populate
    *    an 'indexed' property of beans - defaults to <code>LazyDynaBean</code>
    *    type.</p>
    *
    * <p>Override this method if you require a different type of
    *    <code>DynaBean</code>.</p>
    */
    protected DynaBean newIndexedBean(String name) {
        return new LazyDynaBean();
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线精品一区二区三区| 丝袜美腿一区二区三区| 国产一区不卡在线| 精品久久国产字幕高潮| 狠狠网亚洲精品| 国产亚洲精品aa午夜观看| 成人免费va视频| 亚洲美女免费在线| 欧美日韩国产综合视频在线观看| 午夜国产精品一区| 日韩免费一区二区| 国产一区二区三区视频在线播放 | 在线播放中文字幕一区| 免费成人美女在线观看.| 精品卡一卡二卡三卡四在线| 国产一区视频导航| 亚洲欧美日韩精品久久久久| 欧美影片第一页| 蜜臀av一级做a爰片久久| 国产欧美一区二区三区鸳鸯浴| 成人av电影免费在线播放| 亚洲永久精品国产| 欧美电视剧免费全集观看| 成人高清视频免费观看| 亚洲高清中文字幕| 久久婷婷国产综合精品青草| 97aⅴ精品视频一二三区| 丝袜美腿亚洲色图| 中文成人av在线| 欧美日韩精品久久久| 国产精品一区二区黑丝| 一区二区三区精品在线| 日韩免费看网站| 色偷偷一区二区三区| 极品美女销魂一区二区三区| 亚洲美女在线一区| 日韩女优毛片在线| 欧美亚洲动漫另类| 国产精品18久久久久久久久久久久| 亚洲人成网站在线| 久久久蜜桃精品| 欧美女孩性生活视频| 成人av网址在线| 免费欧美高清视频| 亚洲黄一区二区三区| 久久久91精品国产一区二区精品| 欧美亚一区二区| 成人高清视频在线观看| 麻豆精品在线播放| 亚洲一区二区三区四区不卡| 中文字幕精品在线不卡| 欧美成人性福生活免费看| 91论坛在线播放| 国产精品一区在线观看乱码| 亚洲国产成人av好男人在线观看| 亚洲电影视频在线| 国产精品久久久久久户外露出| 这里只有精品视频在线观看| 色综合视频在线观看| 成人av网站在线观看免费| 久久 天天综合| 亚洲成人tv网| 亚洲欧美日韩小说| 国产日韩欧美高清在线| 欧美www视频| 欧美一级欧美三级| 欧美三级电影在线看| 99国产精品久久久久久久久久| 久久精品国产亚洲高清剧情介绍 | 国产一区激情在线| 日本不卡的三区四区五区| 亚洲成a人v欧美综合天堂下载| 亚洲视频免费观看| 亚洲日本在线视频观看| 国产精品少妇自拍| 欧美国产精品中文字幕| 久久精品水蜜桃av综合天堂| 久久综合成人精品亚洲另类欧美 | 国产永久精品大片wwwapp| 奇米亚洲午夜久久精品| 日本欧美肥老太交大片| 亚洲一卡二卡三卡四卡五卡| 一级精品视频在线观看宜春院| 亚洲色图欧美偷拍| 一区二区三区国产精品| 亚洲一级不卡视频| 日韩经典中文字幕一区| 国产在线国偷精品免费看| 日本亚洲视频在线| 老司机午夜精品99久久| 国产一区二区调教| 成人免费黄色大片| 色婷婷香蕉在线一区二区| 欧洲精品中文字幕| 欧美日韩一区二区三区四区五区| 在线观看91精品国产入口| 欧美日韩在线一区二区| 欧美绝品在线观看成人午夜影视| 91精品黄色片免费大全| 欧美精品一区二区三区四区| 久久一二三国产| 国产精品美女视频| 亚洲精品国产第一综合99久久| 亚洲国产aⅴ天堂久久| 美女一区二区久久| 国产乱人伦偷精品视频免下载 | 亚洲美女偷拍久久| 日韩国产在线观看一区| 国内精品免费**视频| 成人午夜激情影院| 日本道色综合久久| 日韩午夜激情电影| 日韩毛片在线免费观看| 午夜精品福利久久久| 国产美女在线观看一区| 91在线你懂得| 日韩精品一区在线观看| 国产精品成人一区二区艾草| 亚洲国产精品久久艾草纯爱| 国产自产2019最新不卡| 一本大道久久精品懂色aⅴ| 欧美一区日本一区韩国一区| 国产精品天天摸av网| 亚洲444eee在线观看| 国产suv精品一区二区883| 欧美综合在线视频| 久久九九久久九九| 亚洲成人激情自拍| 成人一级黄色片| 欧美精品在线观看播放| 中文字幕av一区 二区| 亚洲小说欧美激情另类| 成人中文字幕合集| 日韩一级大片在线观看| 亚洲视频一区在线观看| 国产精品一二三| 欧美老人xxxx18| 最新久久zyz资源站| 免费观看久久久4p| 91成人在线精品| 国产亚洲一二三区| 免费一区二区视频| 欧美日韩亚洲综合在线 | 欧美激情资源网| 美女网站在线免费欧美精品| 欧美午夜精品免费| ㊣最新国产の精品bt伙计久久| 国产一区二区伦理片| 日韩欧美电影在线| 亚洲大片在线观看| 在线视频你懂得一区二区三区| 丝袜诱惑亚洲看片| 国产日产欧美一区| 亚洲婷婷综合久久一本伊一区| 国产精品美女久久久久aⅴ国产馆| 中文字幕一区二区三区在线观看 | 精品美女在线播放| 免费成人性网站| 在线观看欧美精品| 日韩欧美国产综合一区| 久久久久久久性| 亚洲图片激情小说| 日韩电影在线一区二区三区| 精品制服美女久久| 不卡影院免费观看| 精品国产伦一区二区三区观看体验| 欧美精品一区二区久久婷婷| 国产三级久久久| 久久66热偷产精品| 韩国精品主播一区二区在线观看| 欧美日韩久久一区| 中文字幕一区二区三区蜜月| 国产激情视频一区二区在线观看 | 一区二区免费在线| 欧美日韩精品一区二区| 亚洲精品综合在线| 欧美在线观看视频在线| 亚洲欧美一区二区三区久本道91| 成人av资源在线| 久久精品视频免费| a亚洲天堂av| 亚洲美女偷拍久久| 色综合天天做天天爱| 亚洲另类春色校园小说| 99久久99精品久久久久久| 亚洲免费观看高清完整版在线观看熊 | 亚洲欧美日韩电影| 欧美日韩一区中文字幕| 亚洲日本在线观看| 欧美精品少妇一区二区三区| 蜜桃久久久久久久| 91精品综合久久久久久| 久久精品国产色蜜蜜麻豆| 日韩欧美国产电影| 成人蜜臀av电影| 一区二区不卡在线视频 午夜欧美不卡在| 99精品国产视频| 青青草国产精品97视觉盛宴 | 欧美精品免费视频| 精品一区二区三区视频|