亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
成人污污视频在线观看| 精品国产百合女同互慰| 欧美精品粉嫩高潮一区二区| 91精品啪在线观看国产60岁| 欧美国产视频在线| 午夜电影久久久| 成人国产精品免费| 日韩女优av电影| 一区二区三区四区乱视频| 久久av资源站| 精品视频1区2区| 亚洲欧美一区二区久久 | 欧美mv和日韩mv的网站| 亚洲免费在线播放| 国产suv精品一区二区6| 91麻豆精品国产91| 亚洲一区二区三区四区在线免费观看 | 亚洲男同1069视频| 国产精品自在在线| 欧美刺激脚交jootjob| 亚洲一区在线视频观看| av不卡在线观看| 国产情人综合久久777777| 青青青爽久久午夜综合久久午夜 | 成人听书哪个软件好| 精品国产不卡一区二区三区| 午夜免费欧美电影| 99久久精品国产麻豆演员表| 欧美国产一区二区在线观看| 国产一区二区三区黄视频| 日韩一区二区三区电影在线观看| 亚洲成av人片一区二区| 欧洲av一区二区嗯嗯嗯啊| 亚洲精品日日夜夜| 在线观看亚洲a| 亚洲综合丁香婷婷六月香| 色综合久久中文综合久久牛| 国产精品成人免费精品自在线观看 | 精品国产伦理网| 国内偷窥港台综合视频在线播放| 欧美成人一区二区| 狠狠狠色丁香婷婷综合久久五月| 日韩精品影音先锋| 捆绑调教一区二区三区| 亚洲精品在线免费观看视频| 国产在线精品国自产拍免费| 国产欧美日韩卡一| 国产成人精品1024| 亚洲丝袜另类动漫二区| 欧洲亚洲精品在线| 日韩黄色免费电影| 日韩久久久精品| 国产精品亚洲成人| 国产精品欧美一级免费| 95精品视频在线| 亚洲午夜久久久久久久久电影院| 欧美日韩黄色一区二区| 久久国产夜色精品鲁鲁99| 国产午夜精品一区二区三区嫩草 | 青青草视频一区| 久久久久9999亚洲精品| 国产·精品毛片| 一区二区三区欧美在线观看| 91.com视频| 懂色av中文字幕一区二区三区| 国产精品的网站| 欧美美女一区二区在线观看| 国产一区视频网站| 亚洲激情综合网| 日韩一区国产二区欧美三区| 国产a久久麻豆| 亚洲国产日韩av| 久久久久国产精品厨房| 欧美亚男人的天堂| 国内精品视频666| 亚洲综合久久av| 2023国产精品自拍| 在线免费不卡电影| 国产一区二区在线观看免费| 亚洲一区二区三区在线看| www成人在线观看| 欧美日韩精品一区二区在线播放| 国产精品一区在线观看乱码 | 国产精品的网站| 精品少妇一区二区三区在线播放 | 国产精品盗摄一区二区三区| 4hu四虎永久在线影院成人| 国产99精品国产| 免费日韩伦理电影| 亚洲人精品午夜| 中文字幕免费一区| 日韩写真欧美这视频| 91老师国产黑色丝袜在线| 精品午夜久久福利影院| 亚洲福利电影网| 亚洲美女淫视频| 欧美国产亚洲另类动漫| 精品欧美久久久| 91精品国产一区二区| 色婷婷综合久久久久中文| 成人激情午夜影院| 国产资源在线一区| 日韩黄色片在线观看| 亚洲国产欧美一区二区三区丁香婷 | 亚洲成av人片在线观看| 亚洲另类色综合网站| 国产免费成人在线视频| 久久综合久久综合亚洲| 精品嫩草影院久久| 欧美一级电影网站| 日韩欧美一级二级三级久久久| 欧美日韩国产影片| 欧美日韩和欧美的一区二区| 一本一道综合狠狠老| 色狠狠色狠狠综合| 亚洲综合另类小说| 久久国产成人午夜av影院| 亚洲精选视频免费看| 国产精品麻豆网站| 日本一区二区三区国色天香| 久久精品一区二区三区不卡牛牛 | 91首页免费视频| www.欧美日韩| 99久久久无码国产精品| 99精品欧美一区二区三区综合在线| 国产精品影视天天线| 国产精品影音先锋| 不卡av在线网| 91麻豆自制传媒国产之光| 91色在线porny| 色88888久久久久久影院野外| 欧美最新大片在线看| 欧美日韩国产一级| 精品国产污网站| 国产欧美一区二区精品久导航| 成人免费一区二区三区在线观看| 亚洲另类春色校园小说| 日韩精品1区2区3区| 国产乱码精品一区二区三区五月婷| 国产激情视频一区二区在线观看| 成人国产精品免费观看视频| 在线观看www91| 91精品国产高清一区二区三区 | 国产精品第五页| 午夜电影网一区| 国产成人丝袜美腿| 91麻豆福利精品推荐| 欧美区在线观看| 久久久99精品免费观看| 亚洲黄网站在线观看| 老司机免费视频一区二区 | 国产丝袜美腿一区二区三区| 亚洲精品亚洲人成人网在线播放| 婷婷久久综合九色综合绿巨人 | 美女看a上一区| 高清av一区二区| 欧美日韩在线播放三区四区| 久久综合九色综合欧美亚洲| 一区二区三区日韩在线观看| 精彩视频一区二区三区| 成人短视频下载| 日韩亚洲欧美高清| 一区二区在线免费观看| 麻豆国产精品一区二区三区| 成人听书哪个软件好| 这里是久久伊人| 亚洲色欲色欲www在线观看| 美女视频免费一区| 欧美伊人久久久久久久久影院 | 欧美电视剧免费全集观看| 中文字幕人成不卡一区| 日韩成人午夜电影| 色综合久久中文字幕综合网| 久久亚洲精华国产精华液 | 欧美一二三四区在线| 亚洲欧美怡红院| 国产麻豆精品theporn| 欧美日韩成人在线一区| 综合久久久久综合| 国产精品99久久不卡二区| 日韩欧美一区二区免费| 天天综合网天天综合色| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲精品在线观| 捆绑调教美女网站视频一区| 欧美日韩一区高清| 亚洲午夜久久久久久久久久久 | 国产精品女主播av| 韩国成人精品a∨在线观看| 884aa四虎影成人精品一区| 亚洲欧美激情小说另类| 成人h动漫精品一区二区| 久久精品日韩一区二区三区| 久久精品国产澳门| 日韩女优视频免费观看| 久久不见久久见中文字幕免费| 欧美一级一级性生活免费录像| 视频一区视频二区中文| 欧美日韩一区二区三区高清 | 国产精品视频yy9299一区|