當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。