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

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

?? dynaactionform.java

?? 這是STRUTS1.2。6的開發包。。這是我從芝APACHE網站下下來
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * $Id: DynaActionForm.java 54929 2004-10-16 16:38:42Z germuska $ 
 *
 * Copyright 2000-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.action;

import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.beanutils.ConversionException;
import org.apache.commons.beanutils.DynaBean;
import org.apache.commons.beanutils.DynaClass;
import org.apache.commons.beanutils.DynaProperty;
import org.apache.struts.config.FormBeanConfig;
import org.apache.struts.config.FormPropertyConfig;


/**
 * <p>Specialized subclass of <code>ActionForm</code> that allows the creation
 * of form beans with dynamic sets of properties, without requiring the
 * developer to create a Java class for each type of form bean.</p>
 *
 * <p><strong>USAGE NOTE</strong> - Since Struts 1.1, the
 * <code>reset</code> method no longer initializes property values to those
 * specified in <code>&lt;form-property&gt;</code> elements in the Struts
 * module configuration file.  If you wish to utilize that behavior, the
 * simplest solution is to subclass <code>DynaActionForm</code> and call
 * the <code>initialize</code> method inside it.</p>
 *
 * @version $Rev: 54929 $ $Date: 2004-10-16 09:38:42 -0700 (Sat, 16 Oct 2004) $
 * @since Struts 1.1
 */
public class DynaActionForm extends ActionForm implements DynaBean {


    // ----------------------------------------------------- Instance Variables


    /**
     * <p>The <code>DynaActionFormClass</code> with which we are associated.
     * </p>
     */
    protected DynaActionFormClass dynaClass = null;


    /**
     * <p>The set of property values for this <code>DynaActionForm</code>,
     * keyed by property name.</p>
     */
    protected HashMap dynaValues = new HashMap();


    // ----------------------------------------------------- ActionForm Methods


    /**
     * <p>Initialize all bean properties to their initial values, as specified
     * in the {@link FormPropertyConfig} elements associated with the
     * definition of this <code>DynaActionForm</code>.</p>
     *
     * @param mapping The mapping used to select this instance
     */
    public void initialize(ActionMapping mapping) {

        String name = mapping.getName();
        if (name == null) {
            return;
        }
        FormBeanConfig config =
            mapping.getModuleConfig().findFormBeanConfig(name);
        if (config == null) {
            return;
        }

        initialize(config);
    }

    public void initialize(FormBeanConfig config) {

        FormPropertyConfig props[] = config.findFormPropertyConfigs();
        for (int i = 0; i < props.length; i++) {
            set(props[i].getName(), props[i].initial());
        }

    }


    // :FIXME: Is there any point in retaining these reset methods
    // since they now simply replicate the superclass behavior?

    /**
     * <p>Reset bean properties to their default state, as needed.
     * This method is called before the properties are repopulated by
     * the controller.</p>
     *
     * <p>The default implementation attempts to forward to the HTTP
     * version of this method.</p>
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public void reset(ActionMapping mapping, ServletRequest request) {
        super.reset(mapping,request);
    }


    /**
     * <p>Reset bean properties to their default state, as needed.  This method is
     * called before the properties are repopulated by the controller.</p>
     *
     * <p>The default implementation (since Struts 1.1) does nothing.
     * Subclasses may override this method to reset bean properties to
     * default values, or the <code>initialize</code> method may be used to
     * initialize property values to those provided in the form property
     * configuration information (which was the behavior of
     * this method in some release candidates).</p>
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping,request);
    }


    // ------------------------------------------------------- DynaBean Methods


    /**
     * <p>Indicates if the specified mapped property contain a value for the
     * specified key value.</p>
     *
     * @param name Name of the property to check
     * @param key Name of the key to check
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     */
    public boolean contains(String name, String key) {

        Object value = dynaValues.get(name);
        if (value == null) {
            throw new NullPointerException
                ("No mapped value for '" + name + "(" + key + ")'");
        } else if (value instanceof Map) {
            return (((Map) value).containsKey(key));
        } else {
            throw new IllegalArgumentException
                ("Non-mapped property for '" + name + "(" + key + ")'");
        }

    }


    /**
     * <p>Return the value of a simple property with the specified name.</p>
     *
     * @param name Name of the property whose value is to be retrieved
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     * @exception NullPointerException if the type specified for the
     *  property is invalid
     */
    public Object get(String name) {

        // Return any non-null value for the specified property
        Object value = dynaValues.get(name);
        if (value != null) {
            return (value);
        }

        // Return a null value for a non-primitive property
        Class type = getDynaProperty(name).getType();
        if (type == null) {
            throw new NullPointerException
                ("The type for property " + name + " is invalid");
        }
        if (!type.isPrimitive()) {
            return (value);
        }

        // Manufacture default values for primitive properties
        if (type == Boolean.TYPE) {
            return (Boolean.FALSE);
        } else if (type == Byte.TYPE) {
            return (new Byte((byte) 0));
        } else if (type == Character.TYPE) {
            return (new Character((char) 0));
        } else if (type == Double.TYPE) {
            return (new Double(0.0));
        } else if (type == Float.TYPE) {
            return (new Float((float) 0.0));
        } else if (type == Integer.TYPE) {
            return (new Integer(0));
        } else if (type == Long.TYPE) {
            return (new Long(0));
        } else if (type == Short.TYPE) {
            return (new Short((short) 0));
        } else {
            return (null);
        }

    }


    /**
     * <p>Return the value of an indexed property with the specified name.
     * </p>
     *
     * @param name Name of the property whose value is to be retrieved
     * @param index Index of the value to be retrieved
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     * @exception IllegalArgumentException if the specified property
     *  exists, but is not indexed
     * @exception IndexOutOfBoundsException if the specified index
     *  is outside the range of the underlying property
     * @exception NullPointerException if no array or List has been
     *  initialized for this property
     */
    public Object get(String name, int index) {

        Object value = dynaValues.get(name);
        if (value == null) {
            throw new NullPointerException
                ("No indexed value for '" + name + "[" + index + "]'");
        } else if (value.getClass().isArray()) {
            return (Array.get(value, index));
        } else if (value instanceof List) {
            return ((List) value).get(index);
        } else {
            throw new IllegalArgumentException
                ("Non-indexed property for '" + name + "[" + index + "]'");
        }

    }


    /**
     * <p>Return the value of a mapped property with the specified name,
     * or <code>null</code> if there is no value for the specified key.
     * </p>
     *
     * @param name Name of the property whose value is to be retrieved
     * @param key Key of the value to be retrieved
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     * @exception IllegalArgumentException if the specified property
     *  exists, but is not mapped
     */
    public Object get(String name, String key) {

        Object value = dynaValues.get(name);
        if (value == null) {
            throw new NullPointerException
                ("No mapped value for '" + name + "(" + key + ")'");
        } else if (value instanceof Map) {
            return (((Map) value).get(key));
        } else {
            throw new IllegalArgumentException
                ("Non-mapped property for '" + name + "(" + key + ")'");
        }

    }


    /**
     * <p>Return the value of a <code>String</code> property with the specified
     * name. This is equivalent to calling
     * <code>(String) dynaForm.get(name)</code>.</p>
     *
     * @param name Name of the property whose value is to be retrieved
     *
     * @throws IllegalArgumentException if there is no property
     *  of the specified name
     * @throws NullPointerException if the type specified for the
     *  property is invalid
     * @throws ClassCastException if the property is not a String.
     * @since Struts 1.2
     */
    public String getString(String name) {

        return (String) this.get(name);

    }


    /**
     * <p>Return the value of a <code>String[]</code> property with the
     * specified name. This is equivalent to calling
     * <code>(String[]) dynaForm.get(name)</code>.</p>
     *
     * @param name Name of the property whose value is to be retrieved
     *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区精品久久99| 欧美三级资源在线| 欧美性三三影院| 久久香蕉国产线看观看99| 亚洲欧美日韩在线播放| 国产一区二三区好的| 欧美日韩精品欧美日韩精品一 | 丰满放荡岳乱妇91ww| 正在播放亚洲一区| 亚洲精品成a人| bt欧美亚洲午夜电影天堂| 精品久久国产字幕高潮| 亚洲第一成年网| 91蝌蚪porny| 国产精品久久久一本精品| 理论片日本一区| 欧美肥妇bbw| 亚洲激情中文1区| 99国产精品久久久久| 国产精品污www在线观看| 精品亚洲国产成人av制服丝袜 | 另类小说欧美激情| 欧美精品视频www在线观看| 亚洲一区在线观看免费观看电影高清 | 中文字幕一区二区三区在线播放 | 亚洲一区二区视频在线观看| 国产精品正在播放| 久久综合久久综合久久| 久久精品999| 日韩免费一区二区三区在线播放| 亚洲成a人片在线不卡一二三区| 97精品国产露脸对白| 国产精品麻豆视频| 99久久精品免费| 亚洲日本va在线观看| www.成人网.com| 亚洲综合男人的天堂| 在线观看91精品国产入口| 亚洲国产精品欧美一二99| 欧美日韩精品综合在线| 麻豆精品蜜桃视频网站| 久久五月婷婷丁香社区| 国产精品夜夜爽| 国产精品国产自产拍高清av| 97精品超碰一区二区三区| 一区二区三区电影在线播| 777欧美精品| 久久69国产一区二区蜜臀| 国产日本亚洲高清| 色8久久精品久久久久久蜜| 亚洲成av人片在线观看| 欧美一个色资源| 国产成人鲁色资源国产91色综| 国产精品人妖ts系列视频| 91麻豆swag| 免费人成精品欧美精品| 国产日韩精品一区二区三区 | 国产成人a级片| 亚洲欧洲中文日韩久久av乱码| 欧美日韩高清影院| 国产一区不卡精品| 亚洲精品一二三四区| 91精品国产入口在线| 国产高清不卡二三区| 亚洲女厕所小便bbb| 欧美一级一级性生活免费录像| 国产伦精品一区二区三区在线观看| 国产精品高清亚洲| 欧美一级淫片007| 99这里都是精品| 免播放器亚洲一区| 日韩一区在线看| 欧美精品一区二区蜜臀亚洲| 99热精品国产| 久久精品二区亚洲w码| 国产精品久久久久久久久久免费看 | 精品婷婷伊人一区三区三| 国产91在线看| 午夜欧美视频在线观看| 欧美激情综合五月色丁香小说| 欧美性猛交一区二区三区精品| 国产成人在线电影| 日韩高清电影一区| 亚洲精品亚洲人成人网在线播放| 精品国产三级电影在线观看| 欧洲av在线精品| 成人激情校园春色| 激情深爱一区二区| 亚洲午夜久久久久久久久电影网 | 亚洲欧美一区二区久久| 精品国产免费一区二区三区四区| 欧美三级在线播放| 9久草视频在线视频精品| 狠狠狠色丁香婷婷综合激情 | 久久疯狂做爰流白浆xx| 亚洲图片欧美综合| 亚洲裸体xxx| 亚洲国产精品t66y| 国产亚洲美州欧州综合国| 7799精品视频| 欧美私模裸体表演在线观看| av在线一区二区| 成人黄色小视频| 丁香五精品蜜臀久久久久99网站| 奇米777欧美一区二区| 亚洲午夜精品一区二区三区他趣| 国产精品国产三级国产普通话99| 精品国产乱码久久久久久影片| 91.xcao| 91精品国产综合久久国产大片 | av激情亚洲男人天堂| 国产一区二区日韩精品| 美女高潮久久久| 日精品一区二区三区| 午夜视频一区二区| 亚洲a一区二区| 午夜精品久久久久久久久久| 亚洲亚洲精品在线观看| 午夜日韩在线电影| 日韩国产欧美在线观看| 成人av免费在线| 99久久久国产精品| 91啪亚洲精品| 在线免费观看视频一区| 欧美日韩亚洲丝袜制服| 欧美亚洲日本国产| 欧美一卡二卡三卡| 亚洲精品一区二区三区99| 久久午夜免费电影| 国产精品精品国产色婷婷| 亚洲欧美日韩国产综合| 尤物av一区二区| 天堂精品中文字幕在线| 激情文学综合网| 91在线视频播放| 欧洲激情一区二区| 日韩精品影音先锋| 欧美国产综合一区二区| 国产精品毛片大码女人| 亚洲精品视频在线观看免费| 亚洲高清不卡在线观看| 麻豆精品在线视频| 成人黄色网址在线观看| 欧美色老头old∨ideo| 日韩精品一区二区三区swag | 日韩欧美精品在线| 国产精品伦理一区二区| 亚洲午夜久久久久久久久电影院| 日韩高清在线一区| 成人av电影在线播放| 91超碰这里只有精品国产| 精品国产91洋老外米糕| 首页国产欧美久久| 夫妻av一区二区| 91福利精品视频| 国产亚洲一区二区三区四区| 夜夜爽夜夜爽精品视频| 国产精品91xxx| 欧美日韩成人一区二区| 国产日韩在线不卡| 日本午夜精品一区二区三区电影 | 极品少妇xxxx精品少妇偷拍| 99久久99久久精品免费看蜜桃| 欧美精品自拍偷拍| 亚洲欧洲av一区二区三区久久| 免费精品99久久国产综合精品| 波多野结衣欧美| 久久只精品国产| 亚洲国产精品一区二区www在线 | 国产精品嫩草影院com| 偷窥国产亚洲免费视频| 不卡的av在线| 久久新电视剧免费观看| 天堂va蜜桃一区二区三区漫画版| 不卡区在线中文字幕| 欧美成人国产一区二区| 午夜欧美一区二区三区在线播放| 波多野结衣精品在线| 2欧美一区二区三区在线观看视频| 亚洲综合激情网| a级高清视频欧美日韩| 国产日本欧洲亚洲| 色综合久久99| 一区二区中文视频| 国产成人精品影视| 欧美一卡二卡在线| 丝瓜av网站精品一区二区| 在线免费不卡电影| 中文字幕一区二区三区精华液 | 色呦呦国产精品| 中文字幕第一区第二区| 国产一区二区三区| 欧美精品一区二区精品网| 欧美a级一区二区| 欧美日韩成人高清| 日本怡春院一区二区| 91精品国产综合久久小美女| 亚洲18色成人| 欧美一区二区播放| 久国产精品韩国三级视频|