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

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

?? puttag.java

?? struts的源代碼
?? JAVA
字號:
/*
 * $Id: PutTag.java 54929 2004-10-16 16:38:42Z germuska $ 
 *
 * Copyright 1999-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.taglib.tiles;

import java.lang.reflect.InvocationTargetException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.struts.taglib.tiles.util.TagUtils;
import org.apache.struts.tiles.AttributeDefinition;
import org.apache.struts.tiles.DefinitionNameAttribute;
import org.apache.struts.tiles.DirectStringAttribute;
import org.apache.struts.tiles.PathAttribute;

/**
 * Put an attribute in enclosing attribute container tag.
 * Enclosing attribute container tag can be : <insert> or <definition>.
 * Exception is thrown if no appropriate tag can be found.
 * Put tag can have following atributes :
 * <li>
 * <ul>name : Name of the attribute</ul>
 * <ul>value | content : value to put as attribute</ul>
 * <ul>type : value type. Only valid if value is a String and is set by
 * value="something" or by a bean.
 * Possible type are : string (value is used as direct string),
 * page | template (value is used as a page url to insert),
 * definition (value is used as a definition name to insert)</ul>
 * <ul>direct : Specify if value is to be used as a direct string or as a
 * page url to insert. This is another way to specify the type. It only apply
 * if value is set as a string, and type is not present.</ul>
 * <ul>beanName : Name of a bean used for setting value. Only valid if value is not set.
 * If property is specified, value come from bean's property. Otherwise, bean
 * itself is used for value.</ul>
 * <ul>beanProperty : Name of the property used for retrieving value.</ul>
 * <ul>beanScope : Scope containing bean. </ul>
 * <ul>role : Role to check when 'insert' will be called. If enclosing tag is
 * &lt;insert&gt;, role is checked immediately. If enclosing tag is
 * &lt;definition&gt;, role will be checked when this definition will be
 * inserted.</ul>
 * </li>
 * Value can also come from tag body. Tag body is taken into account only if
 * value is not set by one of the tag attributes. In this case Attribute type is
 * "string", unless tag body define another type.
 */
public class PutTag extends BodyTagSupport implements ComponentConstants {

    /* JSP Tag attributes */

    /** 
     * Name of attribute to put in component context. 
     */
    protected String attributeName = null;

    /** 
     * Associated attribute value. 
     */
    private Object value = null;

    /** 
     * JSP Template compatibility. 
     */
    private String direct = null;

    /** 
     * Requested type for the value. 
     */
    private String valueType = null;

    /** 
     * Bean name attribute. 
     */
    private String beanName = null;

    /** 
     * Bean property attribute. 
     */
    private String beanProperty = null;

    /** 
     * Bean scope attribute. 
     */
    private String beanScope = null;

    /** 
     * Role attribute. 
     */
    private String role = null;

    /* Internal properties */

    /** 
     * Cached real value computed from tag attributes. 
     */
    protected Object realValue = null;

    /**
     * The body content of this tag.
     */
    protected String body = null;

    /**
     * Default constructor.
     */
    public PutTag() {
        super();
    }

    /**
     * Release all allocated resources.
     */
    public void release() {

        super.release();

        attributeName = null;
        valueType = null;
        direct = null;
        value = null;
        beanName = null;
        beanProperty = null;
        beanScope = null;
        role = null;
        body = null;
    }

    /**
     * Release internal properties.
     */
    protected void releaseInternal() {
        realValue = null;
    }

    /**
     * Set name.
     */
    public void setName(String value) {
        this.attributeName = value;
    }

    /**
     * Get name.
     */
    public String getName() {
        return attributeName;
    }

    /**
     * Set value.
     * Method added to satisfy Tomcat (bug ?).
     */
    public void setValue(String value) {
        this.value = value;
    }

    /**
     * Get value.
     * Method added to satisfy Tomcat (bug ?).
     */
    public String getValue() {
        return (String) this.value;
    }

    /**
     * Set value.
     */
    public void setValue(Object value) {
        this.value = value;
    }

    /**
     * Set property value as an object.
     * Added because some web containers react badly to value as <code>Object</code>.
     */
    public void setObjectValue(Object value) {
        this.value = value;
    }

    /**
     * Set content.
     * Method added to satisfy Tomcat (bug ?).
     */
    public void setContent(String value) {
        this.value = value;
    }

    /**
     * Get content.
     * Method added to satisfy Tomcat (bug ?).
     */
    public String getContent() {
        return (String) value;
    }

    /**
     * Set content.
     */
    public void setContent(Object value) {
        this.value = value;
    }

    /**
     * Set direct.
     * Method added for compatibility with JSP1.1.
     */
    public void setDirect(String isDirect) {
        this.direct = isDirect;
    }

    /**
     * Set type.
     */
    public void setType(String value) {
        this.valueType = value;
    }

    /**
     * Get type.
     */
    public String getType() {
        return this.valueType;
    }

    /**
     * Set bean name.
     */
    public void setBeanName(String value) {
        this.beanName = value;
    }

    /**
     * Get bean name.
     */
    public String getBeanName() {
        return beanName;
    }

    /**
     * Set bean property.
     */
    public void setBeanProperty(String value) {
        this.beanProperty = value;
    }

    /**
     * Get bean property.
     */
    public String getBeanProperty() {
        return beanProperty;
    }

    /**
     * Set bean scope.
     */
    public void setBeanScope(String value) {
        this.beanScope = value;
    }

    /**
     * Get bean scope.
     */
    public String getBeanScope() {
        return beanScope;
    }

    /**
     * Set role attribute.
     * @param role The role the user must be in to store content.
     */
    public void setRole(String role) {
        this.role = role;
    }

    /**
     * Get role attribute
     * @return The role defined in the tag or <code>null</code>.
     */
    public String getRole() {
        return role;
    }

    /**
     * Get real value according to tag attribute.
     * Real value is the value computed after attribute processing.
     * @return Real value.
     * @throws JspException If something goes wrong while getting value from bean.
     */
    public Object getRealValue() throws JspException {
        if (realValue == null) {
            computeRealValue();
        }

        return realValue;
    }

    /**
     * Compute real value according to tag attributes.
     * @throws JspException If something goes wrong while getting value from bean.
     */
    protected void computeRealValue() throws JspException {
        // Compute real value from attributes set.
        realValue = value;

        // If realValue is not set, value must come from body
        if (value == null && beanName == null) {
            // Test body content in case of empty body.
            if (body != null) {
                realValue = body;
            } else {
                realValue = "";
            }
        }

        // Does value comes from a bean ?
        if (realValue == null && beanName != null) {
            getRealValueFromBean();
            return;
        }

        // Is there a type set ?
        // First check direct attribute, and translate it to a valueType.
        // Then, evaluate valueType, and create requested typed attribute.
        // If valueType is not set, use the value "as is".
        if (valueType == null && direct != null) {
            if (Boolean.valueOf(direct).booleanValue() == true) {
                valueType = "string";
            } else {
                valueType = "page";
            }
        }

        if (realValue != null
            && valueType != null
            && !(value instanceof AttributeDefinition)) {

            String strValue = realValue.toString();
            if (valueType.equalsIgnoreCase("string")) {
                realValue = new DirectStringAttribute(strValue);

            } else if (valueType.equalsIgnoreCase("page")) {
                realValue = new PathAttribute(strValue);

            } else if (valueType.equalsIgnoreCase("template")) {
                realValue = new PathAttribute(strValue);

            } else if (valueType.equalsIgnoreCase("instance")) {
                realValue = new DefinitionNameAttribute(strValue);

            } else if (valueType.equalsIgnoreCase("definition")) {
                realValue = new DefinitionNameAttribute(strValue);

            } else { // bad type
                throw new JspException(
                    "Warning - Tag put : Bad type '" + valueType + "'.");
            }
        }

    }

    /**
     * Extract real value from specified bean.
     * @throws JspException If something goes wrong while getting value from bean.
     */
    protected void getRealValueFromBean() throws JspException {
        try {
            Object bean = TagUtils.retrieveBean(beanName, beanScope, pageContext);
            if (bean != null && beanProperty != null) {
                realValue = PropertyUtils.getProperty(bean, beanProperty);
            } else {
                realValue = bean; // value can be null
            }
            
        } catch (NoSuchMethodException ex) {
            throw new JspException(
                "Error - component.PutAttributeTag : Error while retrieving value from bean '"
                    + beanName
                    + "' with property '"
                    + beanProperty
                    + "' in scope '"
                    + beanScope
                    + "'. (exception : "
                    + ex.getMessage());

        } catch (InvocationTargetException ex) {
            throw new JspException(
                "Error - component.PutAttributeTag : Error while retrieving value from bean '"
                    + beanName
                    + "' with property '"
                    + beanProperty
                    + "' in scope '"
                    + beanScope
                    + "'. (exception : "
                    + ex.getMessage());

        } catch (IllegalAccessException ex) {
            throw new JspException(
                "Error - component.PutAttributeTag : Error while retrieving value from bean '"
                    + beanName
                    + "' with property '"
                    + beanProperty
                    + "' in scope '"
                    + beanScope
                    + "'. (exception : "
                    + ex.getMessage());
        }
    }

    /**
     * Do start tag.
     */
    public int doStartTag() throws JspException {

        // clear body content
        body = null;

        // Do we need to evaluate body ?
        if (value == null && beanName == null) {
            return EVAL_BODY_TAG;
        }

        // Value is set, don't evaluate body.
        return SKIP_BODY;
    }

    /**
     * Save the body content of this tag (if any)
     *
     * @exception JspException if a JSP exception has occurred
     */
    public int doAfterBody() throws JspException {

        if (bodyContent != null) {
            body = bodyContent.getString();
        }
        return (SKIP_BODY);

    }

    /**
     * Do end tag.
     */
    public int doEndTag() throws JspException {
        // Call parent tag which in turn does what it want
        callParent();

        // clean up tag handler for reuse.
        releaseInternal();

        return EVAL_PAGE;
    }

    /**
     * Find parent tag which must implement AttributeContainer.
     * @throws JspException If we can't find an appropriate enclosing tag.
     */
    protected void callParent() throws JspException {
        // Get enclosing parent
        PutTagParent enclosingParent = findEnclosingPutTagParent();
        enclosingParent.processNestedTag(this);
    }

    /**
     * Find parent tag which must implement AttributeContainer.
     * @throws JspException If we can't find an appropriate enclosing tag.
     */
    protected PutTagParent findEnclosingPutTagParent() throws JspException {
        try {
            PutTagParent parent =
                (PutTagParent) findAncestorWithClass(this, PutTagParent.class);

            if (parent == null) {
                throw new JspException("Error - tag put : enclosing tag doesn't accept 'put' tag.");
            }

            return parent;

        } catch (ClassCastException ex) {
            throw new JspException("Error - tag put : enclosing tag doesn't accept 'put' tag.");
        }
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人夜色视频网站在线观看| 亚洲美女免费视频| 国产精品综合在线视频| www国产精品av| 91国偷自产一区二区三区观看| 欧美情侣在线播放| 蜜臀av一级做a爰片久久| 精品国产免费视频| www.欧美日韩国产在线| 夜夜精品视频一区二区| 3atv在线一区二区三区| 九色|91porny| 自拍偷拍国产精品| 91精品免费观看| 国产精品香蕉一区二区三区| 国产精品国产三级国产普通话99 | 91色视频在线| 亚洲国产你懂的| 欧美mv日韩mv亚洲| 成人久久视频在线观看| 亚洲综合在线电影| 日韩午夜小视频| 97se亚洲国产综合自在线 | 亚洲欧美福利一区二区| 91精品国产色综合久久不卡蜜臀 | 亚洲国产成人精品视频| 精品女同一区二区| 99热99精品| 欧美aaa在线| 亚洲欧美福利一区二区| 精品久久一区二区三区| 色94色欧美sute亚洲线路一ni | 亚洲欧美日韩中文播放| 91精品午夜视频| 日韩欧美在线影院| 久久精品视频网| 亚洲综合久久av| 欧美zozozo| 精品视频123区在线观看| 国产成人综合自拍| 日韩高清一级片| 亚洲女与黑人做爰| 久久九九影视网| 欧美精品精品一区| 成人黄色电影在线| 麻豆精品久久精品色综合| 一区二区久久久| 国产精品成人一区二区艾草 | 久久精品人人做人人综合 | 久久激五月天综合精品| 亚洲国产中文字幕| 日韩一区在线看| 国产日韩影视精品| 国产精品你懂的在线欣赏| 欧美顶级少妇做爰| 欧美撒尿777hd撒尿| 色综合久久久久网| 成人aa视频在线观看| 国产一区二区在线影院| 日韩国产精品大片| 日韩精品免费视频人成| 亚洲综合清纯丝袜自拍| 亚洲欧美日韩人成在线播放| 欧美国产一区二区| 久久久国产午夜精品| 亚洲精品一区二区三区福利| 91精品国产免费| 6080午夜不卡| 日韩午夜精品电影| 日韩丝袜美女视频| 日韩美女在线视频| 日韩精品一区二区三区视频播放| 91精品国产综合久久香蕉的特点 | 精品在线亚洲视频| 免费成人av资源网| 亚洲欧美国产77777| 亚洲欧洲国产日韩| 国产一区二区三区香蕉| 亚洲青青青在线视频| 中文字幕av一区二区三区高| 久久久久久久精| 中文字幕精品在线不卡| 国产精品色哟哟网站| 中文字幕亚洲一区二区av在线 | 欧美日本免费一区二区三区| 欧美亚洲国产怡红院影院| 欧洲中文字幕精品| 欧美丰满一区二区免费视频| 91精品国产乱| 久久亚洲综合色一区二区三区| 欧美精品一区二区三区久久久| 国产亚洲福利社区一区| 国产精品天干天干在线综合| 亚洲欧美日韩一区二区| 午夜免费久久看| 激情综合网av| 一本大道久久a久久精二百| 欧美日韩一级片网站| 精品日韩一区二区三区| 国产午夜精品一区二区三区视频| 2023国产精品视频| 正在播放一区二区| 91精品一区二区三区久久久久久 | 成人蜜臀av电影| 色综合久久久久综合| 欧美日韩国产天堂| 国产性做久久久久久| 一区二区三区色| 精品一二三四区| 91首页免费视频| 日韩精品一区二区三区中文不卡 | 夜夜嗨av一区二区三区四季av| 午夜精品成人在线| 国产不卡在线视频| 精品视频一区 二区 三区| 国产日韩成人精品| 一区二区三区视频在线看| 久久精品噜噜噜成人av农村| 成人av在线一区二区| 5566中文字幕一区二区电影| 国产精品入口麻豆原神| 麻豆精品国产传媒mv男同| 99v久久综合狠狠综合久久| 欧美中文字幕亚洲一区二区va在线 | 亚洲一区二区四区蜜桃| 韩国中文字幕2020精品| 欧美私模裸体表演在线观看| 久久久久国产免费免费| 午夜影院久久久| 99久久精品一区| 精品成人一区二区三区| 亚洲成精国产精品女| 高清不卡一区二区| 欧美大白屁股肥臀xxxxxx| 国产精品麻豆一区二区| 麻豆精品视频在线观看视频| 99久久精品国产麻豆演员表| 精品少妇一区二区三区免费观看 | 91麻豆精品国产自产在线 | 欧美亚洲自拍偷拍| 国产精品全国免费观看高清| 美女视频黄久久| 欧美日韩视频专区在线播放| 国产精品高清亚洲| 国产欧美一区二区精品性色超碰| 欧美日韩一区二区三区不卡| 亚洲精品第1页| 亚洲人成网站影音先锋播放| 国产精品乡下勾搭老头1| 日韩精品资源二区在线| 午夜久久久久久电影| 在线观看成人免费视频| 亚洲人妖av一区二区| 99re这里只有精品首页| 国产精品麻豆一区二区| 国产不卡视频一区二区三区| 欧美tickle裸体挠脚心vk| 日本亚洲最大的色成网站www| 欧美无人高清视频在线观看| 伊人色综合久久天天人手人婷| av电影天堂一区二区在线观看| 中文字幕不卡在线观看| 成人在线综合网| 国产精品午夜电影| 国产99久久久国产精品| 久久―日本道色综合久久| 国产乱人伦偷精品视频不卡| 久久久久久久久久久黄色| 国产一区二区不卡老阿姨| 久久麻豆一区二区| 国产成a人亚洲| 国产精品久久久久久久久久久免费看| 国产精品小仙女| 久久久久国产精品麻豆| 成人午夜视频福利| 中文字幕精品综合| 9久草视频在线视频精品| 中文字幕字幕中文在线中不卡视频| 99精品视频在线播放观看| 一区二区国产盗摄色噜噜| 欧美日韩亚洲国产综合| 日本在线观看不卡视频| 精品国产精品网麻豆系列| 国产老肥熟一区二区三区| 国产人伦精品一区二区| 99re热视频这里只精品| 亚洲与欧洲av电影| 日韩三级av在线播放| 韩国精品在线观看| 国产精品久久久久久亚洲毛片| 91麻豆成人久久精品二区三区| 午夜视频一区二区| 精品91自产拍在线观看一区| 成人性生交大片免费看视频在线| 亚洲日本在线a| 欧美精品丝袜中出| 高清在线不卡av| 亚洲福利一区二区三区| 精品国产乱码久久久久久牛牛| 高潮精品一区videoshd|