本文整理了Java中org.apache.catalina.Context.addParameter()
方法的一些代码示例,展示了Context.addParameter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.addParameter()
方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:addParameter
[英]Add a new context initialization parameter, replacing any existing value for the specified name.
[中]添加新的上下文初始化参数,替换指定名称的任何现有值。
代码示例来源:origin: OryxProject/oryx
context.addParameter(OryxApplication.class.getName() + ".packages", appResourcesPackages);
context.addParameter(ConfigUtils.class.getName() + ".serialized", serializedConfig);
代码示例来源:origin: org.wso2.ei/service-samples
public void startPeopleService() throws Exception {
final File base = createBaseDirectory();
log.info("Using base folder: " + base.getAbsolutePath());
final Tomcat tomcat = new Tomcat();
tomcat.setPort(8080);
tomcat.setBaseDir(base.getAbsolutePath());
Context context = tomcat.addContext("/", base.getAbsolutePath());
Tomcat.addServlet(context, "CXFServlet", new CXFServlet());
context.addServletMapping("/rest/*", "CXFServlet");
context.addApplicationListener(ContextLoaderListener.class.getName());
context.setLoader(new WebappLoader(Thread.currentThread().getContextClassLoader()));
context.addParameter("contextClass", AnnotationConfigWebApplicationContext.class.getName());
context.addParameter("contextConfigLocation", AppConfig.class.getName());
tomcat.start();
tomcat.getServer().await();
}
代码示例来源:origin: org.wso2.esb/service-samples
public static void main(final String[] args) throws Exception {
final File base = createBaseDirectory();
log.info("Using base folder: " + base.getAbsolutePath());
final Tomcat tomcat = new Tomcat();
tomcat.setPort(8080);
tomcat.setBaseDir( base.getAbsolutePath() );
Context context = tomcat.addContext( "/", base.getAbsolutePath() );
Tomcat.addServlet( context, "CXFServlet", new CXFServlet() );
context.addServletMapping( "/rest/*", "CXFServlet" );
context.addApplicationListener( ContextLoaderListener.class.getName() );
context.setLoader( new WebappLoader( Thread.currentThread().getContextClassLoader() ) );
context.addParameter( "contextClass", AnnotationConfigWebApplicationContext.class.getName() );
context.addParameter( "contextConfigLocation", MusicConfig.class.getName() );
tomcat.start();
tomcat.getServer().await();
}
代码示例来源:origin: org.wso2.ei/service-samples
public static void main(final String[] args) throws Exception {
final File base = createBaseDirectory();
log.info("Using base folder: " + base.getAbsolutePath());
final Tomcat tomcat = new Tomcat();
tomcat.setPort(8080);
tomcat.setBaseDir( base.getAbsolutePath() );
Context context = tomcat.addContext( "/", base.getAbsolutePath() );
Tomcat.addServlet( context, "CXFServlet", new CXFServlet() );
context.addServletMapping( "/rest/*", "CXFServlet" );
context.addApplicationListener( ContextLoaderListener.class.getName() );
context.setLoader( new WebappLoader( Thread.currentThread().getContextClassLoader() ) );
context.addParameter( "contextClass", AnnotationConfigWebApplicationContext.class.getName() );
context.addParameter( "contextConfigLocation", MusicConfig.class.getName() );
tomcat.start();
tomcat.getServer().await();
}
代码示例来源:origin: org.wso2.esb/service-samples
public void startPeopleService() throws Exception {
final File base = createBaseDirectory();
log.info("Using base folder: " + base.getAbsolutePath());
final Tomcat tomcat = new Tomcat();
tomcat.setPort(8080);
tomcat.setBaseDir(base.getAbsolutePath());
Context context = tomcat.addContext("/", base.getAbsolutePath());
Tomcat.addServlet(context, "CXFServlet", new CXFServlet());
context.addServletMapping("/rest/*", "CXFServlet");
context.addApplicationListener(ContextLoaderListener.class.getName());
context.setLoader(new WebappLoader(Thread.currentThread().getContextClassLoader()));
context.addParameter("contextClass", AnnotationConfigWebApplicationContext.class.getName());
context.addParameter("contextConfigLocation", AppConfig.class.getName());
tomcat.start();
tomcat.getServer().await();
}
代码示例来源:origin: org.apache.airavata/airavata-embedded-tomcat
/**
* Add a webapp using normal WEB-INF/web.xml if found.
*
* @param contextPath The context of the webapp, e.g., /foo
* @param webappFilePath The file path of the webapp. Can be the path to a WAR file or a
* directory,
* e.g.,
* 1. /home/azeez/bettertomcat/foo.war
* 2. /home/azeez/bettertomcat/foo
* @return new Context The Context of the deployed webapp
* @throws BetterTomcatException If webapp deployment fails
*/
public Context addWebapp(String contextPath,
String webappFilePath) throws BetterTomcatException {
Context context;
try {
context = tomcat.addWebapp(contextPath, webappFilePath);
if (context.getState().equals(LifecycleState.STOPPED)) {
throw new BetterTomcatException("Webapp " + context + " failed to deploy");
}
if (!unpackWars) {
context.addParameter("antiJARLocking", "false");
context.addParameter("antiResourceLocking", "false");
}
return context;
} catch (ServletException e) {
throw new BetterTomcatException("Webapp failed to deploy", e);
}
}
代码示例来源:origin: org.jboss.jbossas/jboss-as-tomcat
context.addParameter(key, overrideParams.get(key));
代码示例来源:origin: stackoverflow.com
ctx.addParameter("EmbeddedMode", "true");
代码示例来源:origin: com.bsb.common.vaadin/com.bsb.common.vaadin7.embed
/**
* Adds the basic and default configuration of the the current {@link Tomcat}
* instance with the current {@link EmbedVaadinConfig config}.
* <p/>
* Does not map any servlet, though. Sub-classes are responsible to do this
*/
protected void initConfiguration() {
getTomcat().setBaseDir(baseDir.getAbsolutePath());
// Setup HTTP port listening
getTomcat().setPort(getConfig().getPort());
// Setup vaadin production mode
getContext().addParameter(PRODUCTION_MODE_PARAM, String.valueOf(getConfig().isProductionMode()));
}
代码示例来源:origin: org.glassfish.web/web-glue
ctx.addParameter(JSF_HA_ENABLED, "true");
代码示例来源:origin: org.keycloak/keycloak-spring-boot-adapter-core
context.addParameter("keycloak.config.resolver", KeycloakSpringBootConfigResolverWrapper.class.getName());
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
context.addParameter(entry.getKey(), entry.getValue());
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
context.addParameter(entry.getKey(), entry.getValue());
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
context.addParameter(entry.getKey(), entry.getValue());
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
context.addParameter(entry.getKey(), entry.getValue());
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
context.addParameter(entry.getKey(), entry.getValue());
代码示例来源:origin: codefollower/Tomcat-Research
context.addParameter(entry.getKey(), entry.getValue());
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
context.addParameter(entry.getKey(), entry.getValue());
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
context.addParameter(entry.getKey(), entry.getValue());
内容来源于网络,如有侵权,请联系作者删除!