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

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

?? genericportletbean.java

?? spring framework 2.5.4源代碼
?? JAVA
字號:
/*
 * Copyright 2002-2008 the original author or authors.
 *
 * 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.springframework.web.portlet;

import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;

import javax.portlet.GenericPortlet;
import javax.portlet.PortletConfig;
import javax.portlet.PortletContext;
import javax.portlet.PortletException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyAccessorFactory;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.PropertyValues;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceEditor;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.StringUtils;
import org.springframework.web.portlet.context.PortletContextResourceLoader;

/**
 * Simple extension of <code>javax.portlet.GenericPortlet</code> that treats
 * its config parameters as bean properties.
 *
 * <p>A very handy superclass for any type of portlet. Type conversion is automatic.
 * It is also possible for subclasses to specify required properties.
 *
 * <p>This portlet leaves request handling to subclasses, inheriting the default
 * behaviour of GenericPortlet (<code>doDispatch</code>, <code>processAction</code>, etc).
 *
 * <p>This portlet superclass has no dependency on a Spring application context,
 * in contrast to the FrameworkPortlet class which loads its own context.
 *
 * @author William G. Thompson, Jr.
 * @author John A. Lewis
 * @author Juergen Hoeller
 * @since 2.0
 * @see #addRequiredProperty
 * @see #initPortletBean
 * @see #doDispatch
 * @see #processAction
 * @see FrameworkPortlet
 */
public abstract class GenericPortletBean extends GenericPortlet {

	/** Logger available to subclasses */
	protected final Log logger = LogFactory.getLog(getClass());

	/** 
	 * Set of required properties (Strings) that must be supplied as
	 * config parameters to this portlet.
	 */
	private final Set requiredProperties = new HashSet();

	
	/**
	 * Subclasses can invoke this method to specify that this property
	 * (which must match a JavaBean property they expose) is mandatory,
	 * and must be supplied as a config parameter. This method would
	 * normally be called from a subclass constructor.
	 * @param property name of the required property
	 */
	protected final void addRequiredProperty(String property) {
		this.requiredProperties.add(property);
	}

	/**
	 * Map config parameters onto bean properties of this portlet, and
	 * invoke subclass initialization.
	 * @throws PortletException if bean properties are invalid (or required
	 * properties are missing), or if subclass initialization fails.
	 */
	public final void init() throws PortletException {
		if (logger.isInfoEnabled()) {
			logger.info("Initializing portlet '" + getPortletName() + "'");
		}
		
		// Set bean properties from init parameters.
		try {
			PropertyValues pvs = new PortletConfigPropertyValues(getPortletConfig(), this.requiredProperties);
			BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
			ResourceLoader resourceLoader = new PortletContextResourceLoader(getPortletContext());
			bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
			initBeanWrapper(bw);
			bw.setPropertyValues(pvs, true);
		}
		catch (BeansException ex) {
			logger.error("Failed to set bean properties on portlet '" + getPortletName() + "'", ex);
			throw ex;
		}

		// let subclasses do whatever initialization they like
		initPortletBean();

		if (logger.isInfoEnabled()) {
			logger.info("Portlet '" + getPortletName() + "' configured successfully");
		}
	}
	
	/**
	 * Initialize the BeanWrapper for this GenericPortletBean,
	 * possibly with custom editors.
	 * @param bw the BeanWrapper to initialize
	 * @throws BeansException if thrown by BeanWrapper methods
	 * @see org.springframework.beans.BeanWrapper#registerCustomEditor
	 */
	protected void initBeanWrapper(BeanWrapper bw) throws BeansException {
	}


	/**
	 * Overridden method that simply returns <code>null</code> when no
	 * PortletConfig set yet.
	 * @see #getPortletConfig()
	 */
	public final String getPortletName() {
		return (getPortletConfig() != null ? getPortletConfig().getPortletName() : null);
	}

	/**
	 * Overridden method that simply returns <code>null</code> when no
	 * PortletConfig set yet.
	 * @see #getPortletConfig()
	 */
	public final PortletContext getPortletContext() {
		return (getPortletConfig() != null ? getPortletConfig().getPortletContext() : null);
	}


	/**
	 * Subclasses may override this to perform custom initialization.
	 * All bean properties of this portlet will have been set before this
	 * method is invoked. This default implementation does nothing.
	 * @throws PortletException if subclass initialization fails
	 */
	protected void initPortletBean() throws PortletException {
	}


	/**
	 * PropertyValues implementation created from PortletConfig init parameters.
	 */
	private static class PortletConfigPropertyValues extends MutablePropertyValues {

		/**
		 * Create new PortletConfigPropertyValues.
		 * @param config PortletConfig we'll use to take PropertyValues from
		 * @param requiredProperties set of property names we need, where
		 * we can't accept default values
		 * @throws PortletException if any required properties are missing
		 */
		private PortletConfigPropertyValues(PortletConfig config, Set requiredProperties)
			throws PortletException {
				
			Set missingProps = (requiredProperties != null && !requiredProperties.isEmpty()) ?
					new HashSet(requiredProperties) : null;

			Enumeration en = config.getInitParameterNames();
			while (en.hasMoreElements()) {
				String property = (String) en.nextElement();
				Object value = config.getInitParameter(property);
				addPropertyValue(new PropertyValue(property, value));
				if (missingProps != null) {
					missingProps.remove(property);
				}
			}

			// fail if we are still missing properties
			if (missingProps != null && missingProps.size() > 0) {
				throw new PortletException(
					"Initialization from PortletConfig for portlet '" + config.getPortletName() +
					"' failed; the following required properties were missing: " +
					StringUtils.collectionToDelimitedString(missingProps, ", "));
			}
		}
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人一区二区| 91视频观看免费| 欧美一区二区在线观看| 首页综合国产亚洲丝袜| 日韩一区二区三区在线视频| 久久99国产精品久久99| 国产视频一区在线观看| 成人午夜免费视频| 亚洲欧美电影院| 欧美日韩国产综合草草| 激情五月婷婷综合| 日本一区二区三区免费乱视频| 国产一二三精品| 国产精品女人毛片| 欧美自拍丝袜亚洲| 久久99国产精品久久| 综合亚洲深深色噜噜狠狠网站| 欧美视频一区二区三区| 国产综合成人久久大片91| 亚洲视频狠狠干| 欧美一区二区三区在线视频| 国产成人aaa| 亚洲影院免费观看| 26uuu国产一区二区三区| 99久久99久久精品免费看蜜桃| 亚洲va韩国va欧美va| 欧美大白屁股肥臀xxxxxx| av电影天堂一区二区在线观看| 亚洲福利国产精品| 国产日韩欧美麻豆| 欧美伦理影视网| 成人精品国产免费网站| 日本不卡视频在线| 亚洲三级视频在线观看| 精品日韩成人av| 在线视频国内一区二区| 国产精品888| 日韩精品一区第一页| 国产精品久久三| 日韩欧美视频一区| 在线观看免费亚洲| 成人深夜福利app| 麻豆一区二区三| 亚洲国产婷婷综合在线精品| 欧美国产乱子伦| 日韩一区二区三区电影在线观看| 91视频免费播放| 国产成人欧美日韩在线电影| 五月婷婷激情综合| 亚洲精品一二三区| 国产女主播视频一区二区| 日韩一区二区三区四区 | 中文字幕色av一区二区三区| 91精品久久久久久久91蜜桃| 91捆绑美女网站| 国产 欧美在线| 韩国精品一区二区| 久久精工是国产品牌吗| 日韩在线a电影| 视频一区在线视频| 亚洲成人先锋电影| 一区二区三区不卡视频在线观看| 一色屋精品亚洲香蕉网站| 久久婷婷成人综合色| 日韩美女一区二区三区| 欧美一级二级在线观看| 欧美日韩另类一区| 欧美熟乱第一页| 欧美三级欧美一级| 91老师国产黑色丝袜在线| av网站一区二区三区| 成人午夜av电影| 成人免费av资源| 成人永久免费视频| 99精品视频一区二区| 99久久久免费精品国产一区二区| 99在线精品观看| 91在线小视频| 一本色道久久加勒比精品| 在线日韩一区二区| 欧美日产国产精品| 欧美美女一区二区三区| 7777精品伊人久久久大香线蕉的| 91麻豆精品国产91久久久资源速度 | 在线成人av网站| 制服丝袜日韩国产| 日韩精品一区二区三区中文不卡| 日韩欧美不卡在线观看视频| 久久免费电影网| 中文字幕乱码久久午夜不卡| 亚洲欧洲综合另类在线| 亚洲chinese男男1069| 爽好多水快深点欧美视频| 经典三级一区二区| 国产91富婆露脸刺激对白| 99久久久精品| 在线不卡免费av| 欧美精品一区男女天堂| 国产精品久久久久久久久久久免费看| 亚洲欧洲www| 日韩在线一区二区三区| 国产二区国产一区在线观看| 91麻豆国产精品久久| 欧美日韩你懂得| 国产视频一区不卡| 亚洲一本大道在线| 国产一区二区三区最好精华液| av电影一区二区| 日韩三级在线免费观看| 国产精品嫩草影院com| 亚洲国产精品麻豆| 国产精品中文字幕日韩精品| 欧美综合一区二区三区| 精品国产一区二区亚洲人成毛片 | 久久精品国产一区二区三| 成人少妇影院yyyy| 欧美高清性hdvideosex| 中文成人av在线| 日韩专区欧美专区| 丁香婷婷综合网| 欧美高清一级片在线| 国产精品情趣视频| 偷偷要91色婷婷| 粉嫩13p一区二区三区| 欧美日韩国产首页| 中文字幕的久久| 免费高清视频精品| 色婷婷综合久久久中文字幕| 日韩精品在线网站| 亚洲一区视频在线观看视频| 国产白丝网站精品污在线入口| 色老汉av一区二区三区| 中文字幕成人av| 九九**精品视频免费播放| 91国产成人在线| 国产亚洲短视频| 欧美aaaaa成人免费观看视频| 91理论电影在线观看| 国产亚洲精品福利| 天天色天天操综合| 99re在线视频这里只有精品| 亚洲精品一区二区三区99| 日韩**一区毛片| 欧美午夜影院一区| 亚洲色图欧洲色图| 成人久久18免费网站麻豆 | 在线视频国内自拍亚洲视频| 国产欧美精品区一区二区三区| 麻豆精品一区二区| 5858s免费视频成人| 亚洲一区二区三区四区五区中文 | 2020国产成人综合网| 日本欧美在线看| 欧美日韩视频在线第一区| 亚洲国产日日夜夜| 日本韩国一区二区三区| 亚洲精品免费看| 91原创在线视频| 国产精品人成在线观看免费| 懂色av中文字幕一区二区三区| 国产性天天综合网| 成人涩涩免费视频| 国产欧美在线观看一区| 国产福利一区二区三区视频| 国产女同互慰高潮91漫画| 国产91综合一区在线观看| 国产情人综合久久777777| 成人综合在线视频| 国产精品日韩精品欧美在线| 国产91清纯白嫩初高中在线观看| 国产人久久人人人人爽| 成人免费av网站| 亚洲另类在线制服丝袜| 91福利社在线观看| 亚洲一卡二卡三卡四卡| 91精品国产手机| 国产精品一区久久久久| 欧美激情一二三区| 99久久精品免费看国产免费软件| 中文字幕日韩av资源站| 在线观看日产精品| 日韩综合小视频| 久久综合色综合88| 成人黄色一级视频| 亚洲午夜久久久久久久久久久| 欧美一区二区视频在线观看2020| 激情另类小说区图片区视频区| 久久在线免费观看| 成人综合婷婷国产精品久久免费| 亚洲天堂2014| 欧美一区2区视频在线观看| 精品一区二区三区免费播放 | 91精品国产欧美日韩| 久久99蜜桃精品| 一区在线观看视频| 欧美电影一区二区| 国产成人高清在线| 亚洲午夜久久久久久久久久久| 精品国产91乱码一区二区三区| 成人av小说网|