IConfigurationElement[] elements = findConfigurationElementsByExtension( BIRT_WEBAPP_EXTENSION_POINT );
IConfigurationElement[] elements = findConfigurationElementsByExtension( BIRT_RESOURCES_EXTENSION_POINT );
	public static Map initWebapp( Map map )	{		if ( map == null )			map = new HashMap( );		// find configuration elements		IConfigurationElement[] elements = findConfigurationElementsByExtension( BIRT_WEBAPP_EXTENSION_POINT );		if ( elements == null || elements.length <= 0 )			return map;		for ( int i = 0; i < elements.length; i++ )		{			IConfigurationElement[] contextParams = elements[i]					.getChildren( EXT_CONTEXT_PARAM );			IConfigurationElement[] listeners = elements[i]					.getChildren( EXT_LISTENER );			IConfigurationElement[] servlets = elements[i]					.getChildren( EXT_SERVLET );			IConfigurationElement[] servletMappings = elements[i]					.getChildren( EXT_SERVLET_MAPPING );			IConfigurationElement[] taglibs = elements[i]					.getChildren( EXT_TAGLIB );			// context param			if ( contextParams != null )			{				Map son = (Map) map.get( EXT_CONTEXT_PARAM );				if ( son == null )					son = new HashMap( );				for ( int j = 0; j < contextParams.length; j++ )				{					String name = contextParams[j].getAttribute( "name" ); //$NON-NLS-1$					String value = contextParams[j].getAttribute( "value" ); //$NON-NLS-1$					String description = contextParams[j]							.getAttribute( "description" ); //$NON-NLS-1$					// create context-param bean					if ( name != null && value != null )					{						ContextParamBean bean = new ContextParamBean( name,								value );						bean.setDescription( description );						son.put( name, bean );					}				}				map.put( EXT_CONTEXT_PARAM, son );			}			// listener			if ( listeners != null )			{				Map son = (Map) map.get( EXT_LISTENER );				if ( son == null )					son = new HashMap( );				for ( int j = 0; j < listeners.length; j++ )				{					String className = listeners[j].getAttribute( "class" ); //$NON-NLS-1$					String description = listeners[j]							.getAttribute( "description" ); //$NON-NLS-1$					// create listener bean					if ( className != null )					{						ListenerBean bean = new ListenerBean( className );						bean.setDescription( description );						son.put( EXT_LISTENER + j, bean );					}				}				map.put( EXT_LISTENER, son );			}			// servlet			if ( servlets != null )			{				Map son = (Map) map.get( EXT_SERVLET );				if ( son == null )					son = new HashMap( );				for ( int j = 0; j < servlets.length; j++ )				{					String name = servlets[j].getAttribute( "name" ); //$NON-NLS-1$					String className = servlets[j].getAttribute( "class" ); //$NON-NLS-1$					String description = servlets[j]							.getAttribute( "description" ); //$NON-NLS-1$					// create servlet bean					if ( name != null && className != null )					{						ServletBean bean = new ServletBean( name, className );						bean.setDescription( description );						son.put( name, bean );					}				}				map.put( EXT_SERVLET, son );			}			// servlet mapping			if ( servletMappings != null )			{				Map son = (Map) map.get( EXT_SERVLET_MAPPING );				if ( son == null )					son = new HashMap( );				for ( int j = 0; j < servletMappings.length; j++ )				{					String name = servletMappings[j].getAttribute( "name" ); //$NON-NLS-1$					String uri = servletMappings[j].getAttribute( "uri" ); //$NON-NLS-1$					// create servlet-mapping bean					if ( name != null && uri != null )					{						ServletMappingBean bean = new ServletMappingBean( name,								uri );						son.put( uri, bean );					}				}				map.put( EXT_SERVLET_MAPPING, son );			}			// taglib			if ( taglibs != null )			{				Map son = (Map) map.get( EXT_TAGLIB );				if ( son == null )					son = new HashMap( );				for ( int j = 0; j < taglibs.length; j++ )				{					String uri = taglibs[j].getAttribute( "uri" ); //$NON-NLS-1$					String location = taglibs[j].getAttribute( "location" ); //$NON-NLS-1$					// create taglib bean					if ( uri != null && location != null )					{						TagLibBean bean = new TagLibBean( uri, location );						son.put( uri, bean );					}				}				map.put( EXT_TAGLIB, son );			}		}		return map;	}