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

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

?? inserttag.java

?? struts的源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * $Id: InsertTag.java 165160 2005-04-28 16:29:58Z niallp $ 
 *
 * Copyright 1999-2005 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.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
import java.util.StringTokenizer;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.Globals;
import org.apache.struts.taglib.tiles.util.TagUtils;
import org.apache.struts.tiles.AttributeDefinition;
import org.apache.struts.tiles.ComponentContext;
import org.apache.struts.tiles.ComponentDefinition;
import org.apache.struts.tiles.Controller;
import org.apache.struts.tiles.DefinitionAttribute;
import org.apache.struts.tiles.DefinitionNameAttribute;
import org.apache.struts.tiles.DefinitionsFactoryException;
import org.apache.struts.tiles.DirectStringAttribute;
import org.apache.struts.tiles.FactoryNotFoundException;
import org.apache.struts.tiles.NoSuchDefinitionException;
import org.apache.struts.tiles.TilesUtil;

/**
 * This is the tag handler for <tiles:insert>, which includes
 * a template. The tag's body content consists of <tiles:put>
 * tags, which are accessed by <tiles:get> in the template.
 *
 * @version $Rev: 165160 $ $Date: 2005-04-28 17:29:58 +0100 (Thu, 28 Apr 2005) $
 */
public class InsertTag
	extends DefinitionTagSupport
	implements PutTagParent, ComponentConstants, PutListTagParent {

	/** 
	 * The role delimiter. 
	 * @deprecated This will be removed in a release after Struts 1.2.
	 */
	public static final String ROLE_DELIMITER = ",";

	/** 
	 * Commons Logging instance. 
	 */
	protected static Log log = LogFactory.getLog(InsertTag.class);

	/* JSP Tag attributes */

	/** 
	 * Flush attribute value. 
	 */
	protected boolean flush = true;

	/** 
	 * Name to insert. 
	 */
	protected String name = null;

	/**
	 * Name of attribute from which to read page name to include. 
	 */
	protected String attribute = null;

	/** 
	 * Name of bean used as entity to include. 
	 */
	protected String beanName = null;

	/** 
	 * Name of bean property, if any. 
	 */
	protected String beanProperty = null;

	/** 
	 * Scope of bean, if any. 
	 */
	protected String beanScope = null;

	/**
	 * Are errors ignored. This is the property for attribute 'ignore'.
	 * Default value is false, which throw an exception.
	 * Only 'attribute not found' errors are ignored.
	 */
	protected boolean isErrorIgnored = false;

	/**
	 * Name of component instance to include.
	 */
	protected String definitionName = null;

	/* Internal properties */
	/**
	 * Does the end tag need to be processed.
	 * Default value is true. Boolean set in case of ignored errors.
	 */
	protected boolean processEndTag = true;

	/** 
	 * Current component context. 
	 */
	protected ComponentContext cachedCurrentContext;

	/** 
	 * Final handler of tag methods. 
	 */
	protected TagHandler tagHandler = null;

	/** 
	 * Trick to allows inner classes to access pageContext. 
	 */
	protected PageContext pageContext = null;

	/**
	 * Reset member values for reuse. This method calls super.release(),
	 * which invokes TagSupport.release(), which typically does nothing.
	 */
	public void release() {

		super.release();
		attribute = null;
		beanName = null;
		beanProperty = null;
		beanScope = null;

		definitionName = null;
		flush = true;
		name = null;
		page = null;
		role = null;
		isErrorIgnored = false;

		releaseInternal();
	}

	/**
	 * Reset internal member values for reuse.
	 */
	protected void releaseInternal() {
		cachedCurrentContext = null;
		processEndTag = true;
		// pageContext = null;  // orion doesn't set it between two tags
		tagHandler = null;
	}

	/**
	 * Set the current page context.
	 * Called by the page implementation prior to doStartTag().
	 * <p>
	 * Needed to allow inner classes to access pageContext.
	 */
	public void setPageContext(PageContext pc) {
		this.pageContext = pc;
		super.setPageContext(pc);
	}

	/**
	 * Get the pageContext property.
	 */
	public PageContext getPageContext() {
		return pageContext;
	}

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

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

	/**
	 * Set component.
	 */
	public void setComponent(String name) {
		this.page = name;
	}

	/**
	 * Set definition.
	 */
	public void setDefinition(String name) {
		this.definitionName = name;
	}

	/**
	 * Get definition name.
	 */
	public String getDefinitionName() {
		return definitionName;
	}

	/**
	 * Set attribute.
	 */
	public void setAttribute(String value) {
		this.attribute = value;
	}

	/**
	 * 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 flush.
	 */
	public void setFlush(boolean flush) {
		this.flush = flush;
	}

	/**
	 * Get flush.
	 */
	public boolean getFlush() {
		return flush;
	}

	/**
	 * Set flush.
	 * Method added for compatibility with JSP1.1
	 */
	public void setFlush(String flush) {
		this.flush = (Boolean.valueOf(flush).booleanValue());
	}

	/**
	 * Set ignore.
	 */
	public void setIgnore(boolean ignore) {
		this.isErrorIgnored = ignore;
	}

	/**
	 * Get ignore.
	 */
	public boolean getIgnore() {
		return isErrorIgnored;
	}

	/////////////////////////////////////////////////////////////////////////

	/**
	 * Add a body attribute.
	 * Erase any attribute with same name previously set.
	 */
	public void putAttribute(String name, Object value) {
		tagHandler.putAttribute(name, value);
	}

	/**
	 * Process nested &lg;put&gt; tag.
	 * Method calls by nested &lg;put&gt; tags.
	 * Nested list is added to current list.
	 * If role is defined, it is checked immediately.
	 */
	public void processNestedTag(PutTag nestedTag) throws JspException {
		// Check role
		HttpServletRequest request =
			(HttpServletRequest) pageContext.getRequest();
		String role = nestedTag.getRole();
		if (role != null && !request.isUserInRole(role)) {
			// not allowed : skip attribute
			return;
		}

		putAttribute(nestedTag.getName(), nestedTag.getRealValue());
	}

	/**
	 * Process nested &lg;putList&gt; tag.
	 * Method calls by nested &lg;putList&gt; tags.
	 * Nested list is added to sub-component attributes
	 * If role is defined, it is checked immediately.
	 */
	public void processNestedTag(PutListTag nestedTag) throws JspException {
		// Check role
		HttpServletRequest request =
			(HttpServletRequest) pageContext.getRequest();
		String role = nestedTag.getRole();
		if (role != null && !request.isUserInRole(role)) {
			// not allowed : skip attribute
			return;
		}

		// Check if a name is defined
		if (nestedTag.getName() == null) {
			throw new JspException("Error - PutList : attribute name is not defined. It is mandatory as the list is added as attribute of 'insert'.");
		}

		// now add attribute to enclosing parent (i.e. : this object).
		putAttribute(nestedTag.getName(), nestedTag.getList());
	}

	/**
	 * Method calls by nested &lg;putList&gt; tags.
	 * A new list is added to current insert object.
	 */
	public void putAttribute(PutListTag nestedTag) throws JspException {
		// Check role
		HttpServletRequest request =
			(HttpServletRequest) pageContext.getRequest();
		String role = nestedTag.getRole();
		if (role != null && !request.isUserInRole(role)) {
			// not allowed : skip attribute
			return;
		}

		putAttribute(nestedTag.getName(), nestedTag.getList());
	}

	/**
	 * Get current component context.
	 */
	private ComponentContext getCurrentContext() {
		if (cachedCurrentContext == null) {
			cachedCurrentContext =
				(ComponentContext) pageContext.getAttribute(
					ComponentConstants.COMPONENT_CONTEXT,
					PageContext.REQUEST_SCOPE);
		}

		return cachedCurrentContext;
	}

	/**
	 * Get instantiated Controller.
	 * Return controller denoted by controllerType, or <code>null</code> if controllerType
	 * is null.
	 * @throws JspException If controller can't be created.
	 */
	private Controller getController() throws JspException {
		if (controllerType == null) {
			return null;
		}

		try {
			return ComponentDefinition.createController(
				controllerName,
				controllerType);

		} catch (InstantiationException ex) {
			throw new JspException(ex.getMessage());
		}
	}

	/**
	 * Process the start tag by checking tag's attributes and creating appropriate handler.
	 * Possible handlers :
	 * <ul>
	 * <li> URL
	 * <li> definition
	 * <li> direct String
	 * </ul>
	 * Handlers also contain sub-component context.
	 */
	public int doStartTag() throws JspException {

            // Additional fix for Bug 20034 (2005-04-28)
            cachedCurrentContext = null;

		// Check role immediatly to avoid useless stuff.
		// In case of insertion of a "definition", definition's role still checked later.
		// This lead to a double check of "role" ;-(
		HttpServletRequest request =
			(HttpServletRequest) pageContext.getRequest();
		if (role != null && !request.isUserInRole(role)) {
			processEndTag = false;
			return SKIP_BODY;
		}

		try {
			tagHandler = createTagHandler();

		} catch (JspException e) {
			if (isErrorIgnored) {
				processEndTag = false;
				return SKIP_BODY;
			} else {
				throw e;
			}
		}

		return tagHandler.doStartTag();
	}

	/**
	 * Process the end tag by including the template.
	 * Simply call the handler doEndTag
	 */
	public int doEndTag() throws JspException {
		if (!processEndTag) {
			releaseInternal();
			return EVAL_PAGE;
		}

		int res = tagHandler.doEndTag();
		// Reset properties used by object, in order to be able to reuse object.
		releaseInternal();
		return res;
	}

	/**
	 * Process tag attribute and create corresponding tag handler.
	 */
	public TagHandler createTagHandler() throws JspException {
		// Check each tag attribute.
		// page Url attribute must be the last checked  because it can appears concurrently
		// with others attributes.
		if (definitionName != null) {
			return processDefinitionName(definitionName);
		} else if (attribute != null) {
			return processAttribute(attribute);
		} else if (beanName != null) {
			return processBean(beanName, beanProperty, beanScope);
		} else if (name != null) {
			return processName(name);
		} else if (page != null) {
			return processUrl(page);
		} else {
			throw new JspException("Error - Tag Insert : At least one of the following attribute must be defined : template|page|attribute|definition|name|beanName. Check tag syntax");
		}
	}

	/**
	 * Process an object retrieved as a bean or attribute.
	 * Object can be a typed attribute, a String, or anything else.
	 * If typed attribute, use associated type.
	 * Otherwise, apply toString() on object, and use returned string as a name.
	 * @throws JspException - Throws by underlying nested call to 
	 * processDefinitionName()
	 */
	public TagHandler processObjectValue(Object value) throws JspException {
		// First, check if value is one of the Typed Attribute
		if (value instanceof AttributeDefinition) {
			// We have a type => return appropriate IncludeType
			return processTypedAttribute((AttributeDefinition) value);

		} else if (value instanceof ComponentDefinition) {
			return processDefinition((ComponentDefinition) value);
		}

		// Value must denote a valid String
		return processAsDefinitionOrURL(value.toString());
	}

	/**
	 * Process name.
	 * Search in following order :
	 * <ul>
	 * <li>Component context -  if found, process it as value.</li>
	 * <li>definitions factory</li>
	 * <li>URL</li>
	 * <li></li>
	 * </ul>
	 *
	 * @return appropriate tag handler.
	 * @throws JspException - Throws by underlying nested call to 
	 * processDefinitionName()
	 */
	public TagHandler processName(String name) throws JspException {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
4438亚洲最大| 国产精品国产三级国产aⅴ无密码| 欧美日韩视频不卡| 欧美日韩亚洲国产综合| 欧美色欧美亚洲另类二区| 色猫猫国产区一区二在线视频| 91久久久免费一区二区| 色婷婷综合久久久| 这里只有精品电影| 欧美精品一区二区三区视频 | 久久综合久久99| 国产日产欧美一区| 综合欧美一区二区三区| 日韩av午夜在线观看| 国产一区二区在线观看视频| 成人av午夜影院| 欧美日韩视频第一区| 欧美成人一级视频| 一区二区视频在线| 免费人成在线不卡| 色综合天天在线| 久久亚洲一级片| 亚洲v中文字幕| 在线精品国精品国产尤物884a| 91精品国产综合久久精品性色| 国产日韩成人精品| 日韩中文字幕麻豆| 一本久久a久久精品亚洲| 精品理论电影在线| 亚洲第四色夜色| 色婷婷激情综合| 国产精品久久久久久久午夜片| 日日欢夜夜爽一区| 91久久精品一区二区三区| 日本一区二区视频在线| 国产综合色精品一区二区三区| 欧美日本在线观看| 亚洲电影一级片| 欧美精品在线一区二区三区| 亚洲综合精品自拍| 在线看不卡av| 亚洲不卡在线观看| 欧美一级片在线看| 激情小说欧美图片| 免费xxxx性欧美18vr| 91视频精品在这里| 5858s免费视频成人| 精品国产91乱码一区二区三区 | 精品不卡在线视频| 伊人色综合久久天天| 欧美日韩国产影片| 丝袜国产日韩另类美女| 精品日韩欧美在线| 久久成人免费电影| 91精品国产色综合久久不卡蜜臀 | 日韩美一区二区三区| 国产一区二区三区在线观看精品| 精品国产一区二区三区不卡 | 日本午夜精品视频在线观看| 欧美一区日本一区韩国一区| 久久国产人妖系列| 亚洲精品成a人| 欧美成人精品高清在线播放| 成人午夜伦理影院| 三级欧美在线一区| 国产农村妇女精品| 日韩三级在线观看| 色视频成人在线观看免| 国精产品一区一区三区mba视频| 国产精品久久久久久亚洲伦| 日韩免费看的电影| 欧美日韩亚洲综合一区二区三区| 国产福利电影一区二区三区| 亚洲chinese男男1069| 国产精品久久久久天堂| 久久夜色精品一区| 欧美电影免费提供在线观看| 欧美日韩精品欧美日韩精品一综合| 国产成人免费视频网站| 久久国产精品无码网站| 亚洲电影一级片| 亚洲免费av网站| 亚洲天堂av一区| 欧美国产日韩精品免费观看| 国产校园另类小说区| 精品日产卡一卡二卡麻豆| 9191精品国产综合久久久久久| 色综合天天性综合| 欧美日韩视频在线一区二区| 欧美人xxxx| 日韩精品一区二区三区视频 | 懂色av一区二区三区免费观看 | 日本一区二区三级电影在线观看| 欧美mv日韩mv| 国产精品成人午夜| 亚洲在线中文字幕| 精品伊人久久久久7777人| 黄网站免费久久| 菠萝蜜视频在线观看一区| 欧美亚一区二区| 欧美一级片在线观看| 久久久精品免费免费| 亚洲精品成人悠悠色影视| 日本中文在线一区| 成人国产亚洲欧美成人综合网| 色综合久久久久| 精品日韩欧美一区二区| 亚洲精品免费视频| 麻豆国产精品官网| 欧美亚洲尤物久久| 久久久久久久久97黄色工厂| 亚洲免费大片在线观看| aaa欧美色吧激情视频| 欧美性极品少妇| 色吧成人激情小说| 成人免费黄色在线| 成人午夜免费av| 97久久精品人人做人人爽50路| 国产精品丝袜黑色高跟| 一区二区三区视频在线观看| 激情亚洲综合在线| 欧美久久久久免费| 一区二区三区中文在线| 国产精一区二区三区| 欧美成人精品福利| 亚洲h在线观看| 欧美日韩精品一区二区| 国产精品国产三级国产普通话蜜臀 | 成人ar影院免费观看视频| 欧美精品欧美精品系列| 亚洲综合网站在线观看| 91麻豆蜜桃一区二区三区| 国产无遮挡一区二区三区毛片日本| 男男视频亚洲欧美| 欧美一级视频精品观看| 日韩制服丝袜先锋影音| 欧美一区二区性放荡片| 裸体在线国模精品偷拍| www国产精品av| 国产精品456露脸| 国产精品久久久久久久浪潮网站| 床上的激情91.| 国产精品福利一区二区三区| 色综合天天综合网天天狠天天| 亚洲乱码中文字幕| 制服.丝袜.亚洲.另类.中文| 日本一不卡视频| 国产视频911| 欧美精品久久久久久久久老牛影院| 天天影视网天天综合色在线播放| 日韩精品一区二区三区中文不卡| 国产91精品一区二区| 亚洲成人在线网站| 2023国产精华国产精品| 色呦呦国产精品| 国产精品一线二线三线| 亚洲国产日韩精品| 久久九九影视网| 欧美一区二区视频网站| 成人18视频在线播放| 狂野欧美性猛交blacked| 国产精品国产精品国产专区不片| 欧美人与性动xxxx| 日本乱码高清不卡字幕| 国产精品一线二线三线| 久久超碰97中文字幕| 亚洲风情在线资源站| 亚洲欧美日韩小说| 国产精品女同互慰在线看| 精品久久久久香蕉网| 日韩欧美视频在线| 欧美猛男超大videosgay| 欧美综合视频在线观看| 99久久久无码国产精品| 亚洲免费伊人电影| 国产精品三级视频| 国产精品情趣视频| 中文字幕av一区 二区| 国产精品美女久久久久av爽李琼| 久久久久高清精品| 国产精品美女久久久久久久久久久| 久久久久国产精品人| 国产精品高清亚洲| 亚洲日本在线观看| 亚洲高清免费观看高清完整版在线观看| 日韩毛片视频在线看| 亚洲精品国产a| 韩国成人福利片在线播放| 国产福利精品导航| 欧美日韩一本到| 国产婷婷一区二区| 亚洲在线观看免费| 久草在线在线精品观看| 色综合 综合色| 欧美一级二级三级乱码| 欧美性色欧美a在线播放| 99久久国产综合精品色伊| 96av麻豆蜜桃一区二区| 91在线播放网址| 欧美丝袜丝交足nylons图片|