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

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

?? inserttag.java

?? struts的源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
		Object attrValue = getCurrentContext().getAttribute(name);

		if (attrValue != null) {
			return processObjectValue(attrValue);
		}

		return processAsDefinitionOrURL(name);
	}

	/**
	 * Process the url.
	 * @throws JspException If failed to create controller
	 */
	public TagHandler processUrl(String url) throws JspException {
		return new InsertHandler(url, role, getController());
	}

	/**
	 * Process tag attribute "definition".
	 * First, search definition in the factory, then create handler from this definition.
	 * @param name Name of the definition.
	 * @return Appropriate TagHandler.
	 * @throws JspException- NoSuchDefinitionException No Definition  found for name.
	 * @throws JspException- FactoryNotFoundException Can't find Definitions factory.
	 * @throws JspException- DefinedComponentFactoryException General error in factory.
	 * @throws JspException InstantiationException Can't create requested controller
	 */
	protected TagHandler processDefinitionName(String name)
		throws JspException {

		try {
			ComponentDefinition definition =
				TilesUtil.getDefinition(
					name,
					(HttpServletRequest) pageContext.getRequest(),
					pageContext.getServletContext());

			if (definition == null) { // is it possible ?
				throw new NoSuchDefinitionException();
			}

			return processDefinition(definition);

		} catch (NoSuchDefinitionException ex) {
			throw new JspException(
				"Error -  Tag Insert : Can't get definition '"
					+ definitionName
					+ "'. Check if this name exist in definitions factory.");

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

		} catch (DefinitionsFactoryException ex) {
			if (log.isDebugEnabled()) {
				ex.printStackTrace();
			}

			// Save exception to be able to show it later
			pageContext.setAttribute(
				Globals.EXCEPTION_KEY,
				ex,
				PageContext.REQUEST_SCOPE);
			throw new JspException(ex.getMessage());
		}
	}

	/**
	 * End of Process tag attribute "definition".
	 * Overload definition with tag attributes "template" and "role".
	 * Then, create appropriate tag handler.
	 * @param definition Definition to process.
	 * @return Appropriate TagHandler.
	 * @throws JspException InstantiationException Can't create requested controller
	 */
	protected TagHandler processDefinition(ComponentDefinition definition)
		throws JspException {
		// Declare local variable in order to not change Tag attribute values.
		String role = this.role;
		String page = this.page;
		Controller controller = null;

		try {
			controller = definition.getOrCreateController();

			// Overload definition with tag's template and role.
			if (role == null) {
				role = definition.getRole();
			}

			if (page == null) {
				page = definition.getTemplate();
			}

			if (controllerName != null) {
				controller =
					ComponentDefinition.createController(
						controllerName,
						controllerType);
			}

			// Can check if page is set
			return new InsertHandler(
				definition.getAttributes(),
				page,
				role,
				controller);

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

	/**
	 * Process a bean.
	 * Get bean value, eventually using property and scope. Found value is process by processObjectValue().
	 * @param beanName Name of the bean
	 * @param beanProperty Property in the bean, or null.
	 * @param beanScope bean scope, or null.
	 * @return Appropriate TagHandler.
	 * @throws JspException - NoSuchDefinitionException No value associated to bean.
	 * @throws JspException an error occur while reading bean, or no definition found.
	 * @throws JspException - Throws by underlying nested call to processDefinitionName()
	 */
	protected TagHandler processBean(
		String beanName,
		String beanProperty,
		String beanScope)
		throws JspException {

		Object beanValue =
			TagUtils.getRealValueFromBean(
				beanName,
				beanProperty,
				beanScope,
				pageContext);

		if (beanValue == null) {
			throw new JspException(
				"Error - Tag Insert : No value defined for bean '"
					+ beanName
					+ "' with property '"
					+ beanProperty
					+ "' in scope '"
					+ beanScope
					+ "'.");
		}

		return processObjectValue(beanValue);
	}

	/**
	 * Process tag attribute "attribute".
	 * Get value from component attribute.
	 * Found value is process by processObjectValue().
	 * @param name Name of the attribute.
	 * @return Appropriate TagHandler.
	 * @throws JspException - NoSuchDefinitionException No Definition  found for name.
	 * @throws JspException - Throws by underlying nested call to processDefinitionName()
	 */
	public TagHandler processAttribute(String name) throws JspException {
		Object attrValue = getCurrentContext().getAttribute(name);

		if (attrValue == null) {
			throw new JspException(
				"Error - Tag Insert : No value found for attribute '"
					+ name
					+ "'.");
		}

		return processObjectValue(attrValue);
	}

	/**
	 * Try to process name as a definition, or as an URL if not found.
	 * @param name Name to process.
	 * @return appropriate TagHandler
	 * @throws JspException InstantiationException Can't create requested controller
	 */
	public TagHandler processAsDefinitionOrURL(String name)
		throws JspException {
		try {
			ComponentDefinition definition =
				TilesUtil.getDefinition(
					name,
					pageContext.getRequest(),
					pageContext.getServletContext());

			if (definition != null) {
				return processDefinition(definition);
			}

		} catch (DefinitionsFactoryException ex) {
			// silently failed, because we can choose to not define a factory.
		}

		// no definition found, try as url
		return processUrl(name);
	}

	/**
	 * Process typed attribute according to its type.
	 * @param value Typed attribute to process.
	 * @return appropriate TagHandler.
	 * @throws JspException - Throws by underlying nested call to processDefinitionName()
	 */
	public TagHandler processTypedAttribute(AttributeDefinition value)
		throws JspException {
		if (value instanceof DirectStringAttribute) {
			return new DirectStringHandler((String) value.getValue());

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

		} else if (value instanceof DefinitionNameAttribute) {
			return processDefinitionName((String) value.getValue());
		}

		return new InsertHandler(
			(String) value.getValue(),
			role,
			getController());
	}

	/**
	 * Do an include of specified page.
	 * This method is used internally to do all includes from this class. It delegates
	 * the include call to the TilesUtil.doInclude().
	 * @param page The page that will be included
	 * @throws ServletException - Thrown by call to pageContext.include()
	 * @throws IOException - Thrown by call to pageContext.include()
	 */
	protected void doInclude(String page)
		throws ServletException, IOException {
		TilesUtil.doInclude(page, pageContext);
	}

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

	/**
	 * Inner Interface.
	 * Sub handler for tag.
	 */
	protected interface TagHandler {
		/**
		 * Create ComponentContext for type depicted by implementation class.
		 */
		public int doStartTag() throws JspException;
		/**
		 * Do include for type depicted by implementation class.
		 */
		public int doEndTag() throws JspException;
		/**
		 * Add a component parameter (attribute) to subContext.
		 */
		public void putAttribute(String name, Object value);
	} // end inner interface

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

	/**
	 * Real handler, after attribute resolution.
	 * Handle include sub-component.
	 */
	protected class InsertHandler implements TagHandler {
		protected String page;
		protected ComponentContext currentContext;
		protected ComponentContext subCompContext;
		protected String role;
		protected Controller controller;

		/**
		 * Constructor.
		 * Create insert handler using Component definition.
		 */
		public InsertHandler(
			Map attributes,
			String page,
			String role,
			Controller controller) {

			this.page = page;
			this.role = role;
			this.controller = controller;
			subCompContext = new ComponentContext(attributes);
		}

		/**
		 * Constructor.
		 * Create insert handler to insert page at specified location.
		 */
		public InsertHandler(String page, String role, Controller controller) {
			this.page = page;
			this.role = role;
			this.controller = controller;
			subCompContext = new ComponentContext();
		}

		/**
		 * Create a new empty context.
		 */
		public int doStartTag() throws JspException {
			// Check role
			HttpServletRequest request =
				(HttpServletRequest) pageContext.getRequest();

			if (role != null && !request.isUserInRole(role)) {
				return SKIP_BODY;
			}

			// save current context
			this.currentContext = getCurrentContext();
			return EVAL_BODY_INCLUDE;
		}

		/**
		 * Add attribute to sub context.
		 * Do nothing.
		 */
		public void putAttribute(String name, Object value) {
			subCompContext.putAttribute(name, value);
		}

		/**
		 * Include requested page.
		 */
		public int doEndTag() throws JspException {
			// Check role
			HttpServletRequest request =
				(HttpServletRequest) pageContext.getRequest();

			if (role != null && !request.isUserInRole(role)) {
				return EVAL_PAGE;
			}

			try {
				if (log.isDebugEnabled()) {
					log.debug("insert page='" + page + "'.");
				}

				// set new context for included component.
				pageContext.setAttribute(
					ComponentConstants.COMPONENT_CONTEXT,
					subCompContext,
					PageContext.REQUEST_SCOPE);

				// Call controller if any
				if (controller != null) {
					try {
						controller.execute(
							subCompContext,
							(HttpServletRequest) pageContext.getRequest(),
							(HttpServletResponse) pageContext.getResponse(),
							pageContext.getServletContext());
                            
					} catch (Exception e) {
						throw new ServletException(e);
					}

				}

				// include requested component.
				if (flush) {
					pageContext.getOut().flush();
				}

				doInclude(page);

			} catch (IOException e) {
				String msg =
					"Can't insert page '" + page + "' : " + e.getMessage();
				log.error(msg, e);
				throw new JspException(msg);

			} catch (IllegalArgumentException e) {
				// Can't resolve page uri, should we ignore it?
				if (!(page == null && isErrorIgnored)) {
					String msg =
						"Can't insert page '"
							+ page
							+ "'. Check if it exists.\n"
							+ e.getMessage();

					log.error(msg, e);
					throw new JspException(msg);
				}

			} catch (ServletException e) {
				Throwable cause = e;
				if (e.getRootCause() != null) {
					cause = e.getRootCause();
				}

				String msg =
					"ServletException in '" + page + "': " + cause.getMessage();

				log.error(msg, e);
				throw new JspException(msg);

			} finally {
				// restore old context only if currentContext not null 
				// (bug with Silverstream ?; related by Arvindra Sehmi 20010712)
				if (currentContext != null) {
					pageContext.setAttribute(
						ComponentConstants.COMPONENT_CONTEXT,
						currentContext,
						PageContext.REQUEST_SCOPE);
				}
			}

			return EVAL_PAGE;
		}

		/**
		 * Process an exception.
		 * Depending of debug attribute, print full exception trace or only
		 * its message in output page.
		 * @param ex Exception
		 * @param msg An additional message to show in console and to propagate if we can't output exception.
		 * @deprecated This method will be removed in a release after Struts 1.2.
		 */
		protected void processException(Throwable ex, String msg)
			throws JspException {

			try {
				if (msg == null) {
					msg = ex.getMessage();
				}

				if (log.isDebugEnabled()) { // show full trace
					log.debug(msg, ex);
					pageContext.getOut().println(msg);
					ex.printStackTrace(
						new PrintWriter(pageContext.getOut(), true));
				} else { // show only message
					pageContext.getOut().println(msg);
				}

			} catch (IOException ioex) { // problems. Propagate original exception
				pageContext.setAttribute(
					ComponentConstants.EXCEPTION_KEY,
					ex,
					PageContext.REQUEST_SCOPE);
				throw new JspException(msg);
			}
		}
	}

	/**
	 * Parse the list of roles and return <code>true</code> or <code>false</code> based on whether
	 * the user has that role or not.
	 * @param role Comma-delimited list of roles.
	 * @param request The request.
	 */
	static public boolean userHasRole(
		HttpServletRequest request,
		String role) {
		StringTokenizer st = new StringTokenizer(role, ",");
		while (st.hasMoreTokens()) {
			if (request.isUserInRole(st.nextToken())) {
				return true;
			}
		}

		return false;
	}

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

	/**
	 * Handle insert direct string.
	 */
	protected class DirectStringHandler implements TagHandler {
		/** Object to print as a direct string */
		private Object value;

		/**
		 * Constructor.
		 */
		public DirectStringHandler(Object value) {
			this.value = value;
		}

		/**
		 * Do nothing, there is no context for a direct string.
		 */
		public int doStartTag() throws JspException {
			return SKIP_BODY;
		}

		/**
		 * Add attribute to sub context.
		 * Do nothing.
		 */
		public void putAttribute(String name, Object value) {
		}

		/**
		 * Print String in page output stream.
		 */
		public int doEndTag() throws JspException {
			try {
				if (flush) {
					pageContext.getOut().flush();
				}

				pageContext.getOut().print(value);

			} catch (IOException ex) {
				if (log.isDebugEnabled()) {
					log.debug("Can't write string '" + value + "' : ", ex);
				}

				pageContext.setAttribute(
					ComponentConstants.EXCEPTION_KEY,
					ex,
					PageContext.REQUEST_SCOPE);

				throw new JspException(
					"Can't write string '" + value + "' : " + ex.getMessage());
			}

			return EVAL_PAGE;
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
强制捆绑调教一区二区| 亚洲女与黑人做爰| 亚洲成人激情社区| 国产精品一区二区在线播放| 欧美这里有精品| 亚洲国产精品av| 久久99精品视频| 一本到不卡免费一区二区| 2019国产精品| 日本伊人午夜精品| 欧美亚洲高清一区二区三区不卡| 欧美高清在线视频| 国产在线麻豆精品观看| 久久97超碰国产精品超碰| 国产一区二区三区av电影 | 视频一区视频二区在线观看| 成人动漫一区二区| 国产午夜精品在线观看| 蜜臀va亚洲va欧美va天堂| 欧美性大战久久| 亚洲精品视频免费看| 成人午夜在线播放| 久久久久国色av免费看影院| 精品一区二区国语对白| 欧美一区二区免费观在线| 五月天欧美精品| 欧美视频一区在线| 亚洲另类春色国产| 色综合一区二区| 综合激情成人伊人| 91小视频在线| 亚洲免费av在线| 一本一道波多野结衣一区二区| 中文字幕亚洲一区二区av在线 | 亚洲va国产天堂va久久en| 色综合久久66| 亚洲精品国产第一综合99久久| 99久久久久久| **欧美大码日韩| 99re热视频精品| 亚洲天堂av一区| 色综合久久久久综合| 亚洲视频一区二区在线| 色吊一区二区三区| 一区二区国产盗摄色噜噜| 欧美在线三级电影| 亚洲成av人片在www色猫咪| 欧美日韩精品系列| 亚洲r级在线视频| 欧美男女性生活在线直播观看| 三级欧美韩日大片在线看| 日韩一区二区三区视频在线| 麻豆高清免费国产一区| 欧美精品一区二区在线播放| 国产麻豆精品在线| 国产精品免费久久久久| 91日韩在线专区| 亚洲综合色视频| 欧美一区二区三区系列电影| 久久超碰97中文字幕| 国产欧美日韩另类视频免费观看| 成人免费高清在线观看| 自拍av一区二区三区| 欧美乱妇23p| 国产一区视频导航| 国产精品久久久久久久久动漫 | 成人国产精品免费网站| 亚洲天天做日日做天天谢日日欢| 99国产精品一区| 亚洲自拍欧美精品| 91精品蜜臀在线一区尤物| 久久99热狠狠色一区二区| 国产欧美一区二区精品性色超碰| 99精品在线免费| 日韩电影在线免费观看| 久久久精品综合| 色噜噜狠狠成人中文综合 | 亚洲欧美偷拍另类a∨色屁股| 欧美年轻男男videosbes| 国精产品一区一区三区mba桃花 | 国产精品三级视频| 亚洲不卡一区二区三区| 日本成人中文字幕| 亚州成人在线电影| 亚洲尤物视频在线| 亚洲六月丁香色婷婷综合久久| 久久综合网色—综合色88| 欧美性色黄大片| 欧美日韩国产高清一区二区三区| 不卡一区在线观看| 国产一区二区免费视频| 国产精品1024| 日本三级韩国三级欧美三级| 久久亚洲欧美国产精品乐播| 91香蕉视频污在线| 奇米影视一区二区三区| 国产精品丝袜91| 538prom精品视频线放| 成人自拍视频在线观看| 无码av免费一区二区三区试看| www久久久久| 在线区一区二视频| 国产成人av自拍| 天天综合天天综合色| 欧美国产精品中文字幕| 欧美一区二区三区在线电影 | 亚洲免费电影在线| 久久综合色婷婷| 欧美在线观看视频一区二区| 国产福利一区二区三区视频| 亚洲国产美女搞黄色| 欧美激情在线一区二区三区| 91麻豆精品国产综合久久久久久| aaa欧美日韩| 精品一区二区成人精品| 亚洲韩国精品一区| 日韩一区欧美小说| 国产午夜精品理论片a级大结局| 欧美精品1区2区| 91免费版在线看| 国产成人精品三级| 精品一区二区三区av| 性久久久久久久| 亚洲精品福利视频网站| 国产欧美日韩亚州综合| 精品奇米国产一区二区三区| 欧美日韩国产123区| 91免费观看视频| 成人福利视频在线看| 国产专区欧美精品| 男女男精品视频网| 偷窥国产亚洲免费视频| 亚洲精品视频在线| 亚洲视频一区二区在线| 国产区在线观看成人精品| 欧美大度的电影原声| 欧美二区在线观看| 欧美日韩中文字幕一区| 在线免费一区三区| 美女性感视频久久| 成人欧美一区二区三区1314| 亚洲国产成人自拍| 国产日产欧美一区二区视频| 久久伊99综合婷婷久久伊| 日韩色视频在线观看| 欧美一区二区三区系列电影| 制服丝袜成人动漫| 在线播放91灌醉迷j高跟美女| 欧美午夜电影网| 欧美性猛片xxxx免费看久爱| 在线区一区二视频| 在线视频一区二区三区| 在线精品视频一区二区三四| 色拍拍在线精品视频8848| 91社区在线播放| 在线免费观看视频一区| 欧美伊人久久久久久久久影院| 91久久精品日日躁夜夜躁欧美| 一本一本大道香蕉久在线精品| 91啦中文在线观看| 在线观看一区日韩| 欧美综合久久久| 欧美精品久久久久久久多人混战| 6080国产精品一区二区| 欧美电影免费观看高清完整版在线观看 | 国产精品视频线看| 日本一区二区成人| 国产精品不卡在线观看| 一区二区在线观看av| 亚洲成a人v欧美综合天堂下载 | 亚洲国产精品激情在线观看| 国产精品无遮挡| 亚洲丝袜精品丝袜在线| 亚洲与欧洲av电影| 同产精品九九九| 久久av中文字幕片| 国产成人亚洲综合a∨婷婷| 成人性生交大片免费看中文| av不卡在线观看| 欧美日韩在线不卡| 欧美刺激午夜性久久久久久久| 久久网这里都是精品| 国产精品视频线看| 亚洲国产欧美在线人成| 全国精品久久少妇| 国产成人av一区| 色婷婷综合激情| 91精品国产一区二区三区| 久久免费电影网| 亚洲精品乱码久久久久久日本蜜臀| 亚洲女女做受ⅹxx高潮| 久久久久亚洲蜜桃| 成人欧美一区二区三区视频网页| 亚洲一区二区四区蜜桃| 日韩高清不卡在线| 国产成人在线看| 欧美性大战久久久久久久蜜臀| 日韩视频在线观看一区二区| 国产人伦精品一区二区| 亚洲地区一二三色|