当前位置: 首页>>代码示例>>Java>>正文


Java ServletConfig.getInitParameter方法代码示例

本文整理汇总了Java中javax.servlet.ServletConfig.getInitParameter方法的典型用法代码示例。如果您正苦于以下问题:Java ServletConfig.getInitParameter方法的具体用法?Java ServletConfig.getInitParameter怎么用?Java ServletConfig.getInitParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.ServletConfig的用法示例。


在下文中一共展示了ServletConfig.getInitParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: QueueApi

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public QueueApi(@Context ServletConfig servletContext) {
   QueueApiService delegate = null;

   if (servletContext != null) {
      String implClass = servletContext.getInitParameter("QueueApi.implementation");
      if (implClass != null && !"".equals(implClass.trim())) {
         try {
            delegate = (QueueApiService) Class.forName(implClass).newInstance();
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } 
   }

   if (delegate == null) {
      delegate = QueueApiServiceFactory.getQueueApi();
   }

   this.delegate = delegate;
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:21,代码来源:QueueApi.java

示例2: AgentApi

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public AgentApi(@Context ServletConfig servletContext) {
   AgentApiService delegate = null;

   if (servletContext != null) {
      String implClass = servletContext.getInitParameter("AgentApi.implementation");
      if (implClass != null && !"".equals(implClass.trim())) {
         try {
            delegate = (AgentApiService) Class.forName(implClass).newInstance();
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } 
   }

   if (delegate == null) {
      delegate = AgentApiServiceFactory.getAgentApi();
   }

   this.delegate = delegate;
}
 
开发者ID:elastest,项目名称:elastest-instrumentation-manager,代码行数:21,代码来源:AgentApi.java

示例3: PublickeyApi

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public PublickeyApi(@Context ServletConfig servletContext) {
   PublickeyApiService delegate = null;

   if (servletContext != null) {
      String implClass = servletContext.getInitParameter("PublickeyApi.implementation");
      if (implClass != null && !"".equals(implClass.trim())) {
         try {
            delegate = (PublickeyApiService) Class.forName(implClass).newInstance();
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } 
   }

   if (delegate == null) {
      delegate = PublickeyApiServiceFactory.getPublickeyApi();
   }

   this.delegate = delegate;
}
 
开发者ID:elastest,项目名称:elastest-instrumentation-manager,代码行数:21,代码来源:PublickeyApi.java

示例4: CreateItemApi

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public CreateItemApi(@Context ServletConfig servletContext) {
   CreateItemApiService delegate = null;

   if (servletContext != null) {
      String implClass = servletContext.getInitParameter("CreateItemApi.implementation");
      if (implClass != null && !"".equals(implClass.trim())) {
         try {
            delegate = (CreateItemApiService) Class.forName(implClass).newInstance();
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } 
   }

   if (delegate == null) {
      delegate = CreateItemApiServiceFactory.getCreateItemApi();
   }

   this.delegate = delegate;
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:21,代码来源:CreateItemApi.java

示例5: BlueApi

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public BlueApi(@Context ServletConfig servletContext) {
   BlueApiService delegate = null;

   if (servletContext != null) {
      String implClass = servletContext.getInitParameter("BlueApi.implementation");
      if (implClass != null && !"".equals(implClass.trim())) {
         try {
            delegate = (BlueApiService) Class.forName(implClass).newInstance();
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } 
   }

   if (delegate == null) {
      delegate = BlueApiServiceFactory.getBlueApi();
   }

   this.delegate = delegate;
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:21,代码来源:BlueApi.java

示例6: JobApi

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public JobApi(@Context ServletConfig servletContext) {
   JobApiService delegate = null;

   if (servletContext != null) {
      String implClass = servletContext.getInitParameter("JobApi.implementation");
      if (implClass != null && !"".equals(implClass.trim())) {
         try {
            delegate = (JobApiService) Class.forName(implClass).newInstance();
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } 
   }

   if (delegate == null) {
      delegate = JobApiServiceFactory.getJobApi();
   }

   this.delegate = delegate;
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:21,代码来源:JobApi.java

示例7: ViewApi

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public ViewApi(@Context ServletConfig servletContext) {
   ViewApiService delegate = null;

   if (servletContext != null) {
      String implClass = servletContext.getInitParameter("ViewApi.implementation");
      if (implClass != null && !"".equals(implClass.trim())) {
         try {
            delegate = (ViewApiService) Class.forName(implClass).newInstance();
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } 
   }

   if (delegate == null) {
      delegate = ViewApiServiceFactory.getViewApi();
   }

   this.delegate = delegate;
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:21,代码来源:ViewApi.java

示例8: createDefaultContainer

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
/**
 * Create a {@link DefaultContainer}, allowing users to upgrade to a child
 * of DefaultContainer using an {@link ServletConfig} init parameter of
 * <code>org.directwebremoting.Container</code>. Note that while the
 * parameter name is the classname of {@link Container}, currently the only
 * this can only be used to create children that inherit from
 * {@link DefaultContainer}. This restriction may be relaxed in the future.
 * Unlike {@link #setupDefaultContainer(DefaultContainer, ServletConfig)},
 * this method does not call any setup methods.
 * @param servletConfig The source of init parameters
 * @return An unsetup implementaion of DefaultContainer
 * @throws ServletException If the specified class could not be found
 * @see ServletConfig#getInitParameter(String)
 */
public static DefaultContainer createDefaultContainer(ServletConfig servletConfig) throws ServletException
{
    try
    {
        String typeName = servletConfig.getInitParameter(Container.class.getName());
        if (typeName == null)
        {
            return new DefaultContainer();
        }

        log.debug("Using alternate Container implementation: " + typeName);
        Class type = LocalUtil.classForName(typeName);
        return (DefaultContainer) type.newInstance();
    }
    catch (Exception ex)
    {
        throw new ServletException(ex);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:34,代码来源:ContainerUtil.java

示例9: getOption

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
protected static String getOption( ServletConfig config, String name, String defaultV) {
    if( config == null ) return defaultV;

    String value=config.getInitParameter(name);
    if( value != null ) return value;
    if( config.getServletContext() ==null )
        return defaultV;
    value=config.getServletContext().getInitParameter(name);
    if( value!=null ) return value;
    return defaultV;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:TagHandlerPool.java

示例10: readConfigurationProperties

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
protected Map<String, String> readConfigurationProperties(ServletConfig servletConfig) {
  Map<String,String> initParameters = new LinkedHashMap<>();
  Enumeration<String> initParameterNames = servletConfig.getInitParameterNames();
  while (initParameterNames.hasMoreElements()) {
    String initParameterName = initParameterNames.nextElement();
    String initParameterValue = servletConfig.getInitParameter(initParameterName);
    initParameters.put(initParameterName, initParameterValue);
  }
  return initParameters;
}
 
开发者ID:rockscript,项目名称:rockscript,代码行数:11,代码来源:Servlet.java

示例11: init

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public void init(ServletConfig config) throws ServletException
	{
		super.init(config);

		m_Config = DisplayConfig.getInstance() ;

		String path = this.getServletContext().getRealPath("/") ;
		m_Config.setRootPath(path) ;

		String csINIFilePath = config.getInitParameter("INIFilePath");
		csINIFilePath = m_Config.getRootPath() + csINIFilePath ;
		m_Config.LoadConfig(csINIFilePath) ;


/*
		m_ResourceManager.setXMLConfigFilePath(csINIFilePath) ;
		m_ResourceManager.Init() ;
		
		m_ResourceManager.loadDBSemanticContextDef();

		// Load semantic context data dictionnary: Defines semantic context associtaed to DB columns
				
		
		// Load semantic context configuration file: Defines menus, options, ...
		String csSemanticContext = m_ResourceManager.getSemanticContextPathFile();
		if(csSemanticContext != null && csSemanticContext.length() != 0)
		{
			SemanticManager semanticManager = SemanticManager.GetInstance();
			semanticManager.Init(csSemanticContext);
			m_ResourceManager.registerSemanticManager(semanticManager);			
		}
	*/
	}
 
开发者ID:costea7,项目名称:ChronoBike,代码行数:34,代码来源:InitServlet.java

示例12: init

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
public void init(ServletConfig config) throws ServletException
{
    if (config.getInitParameter("ProxyTo")!=null)
        _proxyTo=config.getInitParameter("ProxyTo");
    if (config.getInitParameter("Prefix")!=null)
        _prefix=config.getInitParameter("Prefix");
    if (_proxyTo==null)
        throw new UnavailableException("No ProxyTo");
    super.init(config);

    _context.log("Transparent ProxyServlet @ "+(_prefix==null?"-":_prefix)+ " to "+_proxyTo);

}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:14,代码来源:ProxyServlet.java

示例13: setupFromServletConfig

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
/**
 * Take a DefaultContainer and setup the default beans
 * @param container The container to configure
 * @param servletConfig The servlet configuration (null to ignore)
 * @throws InstantiationException If we can't instantiate a bean
 * @throws IllegalAccessException If we have access problems creating a bean
 */
public static void setupFromServletConfig(DefaultContainer container, ServletConfig servletConfig) throws InstantiationException, IllegalAccessException
{
    Enumeration en = servletConfig.getInitParameterNames();
    while (en.hasMoreElements())
    {
        String name = (String) en.nextElement();
        String value = servletConfig.getInitParameter(name);
        container.addParameter(name, value);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:ContainerUtil.java

示例14: getInitParametersInServletConfig

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private Map<String, String> getInitParametersInServletConfig(ServletConfig servletConfig) {
    Map<String , String> initParameters = new HashMap<String, String>();
    Enumeration<String> params = servletConfig.getInitParameterNames();
    while (params.hasMoreElements()) {
        String name = params.nextElement();
        String value = servletConfig.getInitParameter(name);
        initParameters.put(name, value);
    }
    return Collections.unmodifiableMap(initParameters);
}
 
开发者ID:devefx,项目名称:validator-web,代码行数:12,代码来源:FakeServletConfig.java

示例15: setupLogging

import javax.servlet.ServletConfig; //导入方法依赖的package包/类
/**
 * We have some special logging classes to maintain an optional dependence
 * on commons-logging. This sets the servlet for when this is not available.
 * @param servletConfig The servlet configuration
 * @param servlet The servlet that we are running under
 */
public static void setupLogging(ServletConfig servletConfig, HttpServlet servlet)
{
    ServletLoggingOutput.setExecutionContext(servlet);
    String logLevel = servletConfig.getInitParameter(ContainerUtil.INIT_LOGLEVEL);
    if (logLevel != null)
    {
        ServletLoggingOutput.setLevel(logLevel);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:StartupUtil.java


注:本文中的javax.servlet.ServletConfig.getInitParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。