本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
*/
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}