本文整理了Java中org.apache.catalina.Context.setRealm()
方法的一些代码示例,展示了Context.setRealm()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.setRealm()
方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:setRealm
暂无
代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat
anotherCtxObj.setRealm(realm);
} else {
Realm realm = host.getRealm();
((JAASRealm) realm).setAppName(securityRealmName);
anotherCtxObj.setRealm(realm);
} else {
anotherCtxObj.setRealm(realm);
anotherCtxObj.setRealm(realm);
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.url.mapper.clustermessage
public static void removeVirtualHost(String hostName) {
Engine engine = DataHolder.getInstance().getCarbonTomcatService().getTomcat().getEngine();
Host host = (Host) engine.findChild(hostName);
Context context = (Context) host.findChild("/");
try {
if (host.getState().isAvailable()) {
if (context != null && context.getAvailable()) {
context.setRealm(null);
context.stop();
context.destroy();
log.info("Unloaded webapp from the host: " + host
+ " as the context of: " + context);
}
host.removeChild(context);
host.setRealm(null);
host.stop();
host.destroy();
engine.removeChild(host);
}
}catch (LifecycleException e) {
log.error("error while removing host from tomcat", e);
}
URLMappingHolder.getInstance().removeUrlMappingMap(
host.getName());
log.info("Unloaded host from the engine: " + host);
}
public static Host addHostToEngine(String hostName) {
代码示例来源:origin: org.jboss.jbossas/jboss-as-tomcat
context.setRealm((org.apache.catalina.Realm)TomcatService.getInstance(contextMetaData.getRealm(), null));
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
public Context addWebapp(Host host, String url, String path) {
silence(url);
Context ctx = new StandardContext();
ctx.setPath( url );
ctx.setDocBase(path);
if (defaultRealm == null) {
initSimpleAuth();
}
ctx.setRealm(defaultRealm);
ctx.addLifecycleListener(new DefaultWebXmlListener());
ContextConfig ctxCfg = new ContextConfig();
ctx.addLifecycleListener(ctxCfg);
// prevent it from looking ( if it finds one - it'll have dup error )
ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
if (host == null) {
getHost().addChild(ctx);
} else {
host.addChild(ctx);
}
return ctx;
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
public Context addWebapp(Host host, String url, String path) {
silence(url);
Context ctx = new StandardContext();
ctx.setPath( url );
ctx.setDocBase(path);
if (defaultRealm == null) {
initSimpleAuth();
}
ctx.setRealm(defaultRealm);
ctx.addLifecycleListener(new DefaultWebXmlListener());
ContextConfig ctxCfg = new ContextConfig();
ctx.addLifecycleListener(ctxCfg);
// prevent it from looking ( if it finds one - it'll have dup error )
ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
if (host == null) {
getHost().addChild(ctx);
} else {
host.addChild(ctx);
}
return ctx;
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
public Context addWebapp(Host host, String url, String path) {
silence(url);
Context ctx = new StandardContext();
ctx.setPath( url );
ctx.setDocBase(path);
if (defaultRealm == null) {
initSimpleAuth();
}
ctx.setRealm(defaultRealm);
ctx.addLifecycleListener(new DefaultWebXmlListener());
ContextConfig ctxCfg = new ContextConfig();
ctx.addLifecycleListener(ctxCfg);
// prevent it from looking ( if it finds one - it'll have dup error )
ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
if (host == null) {
getHost().addChild(ctx);
} else {
host.addChild(ctx);
}
return ctx;
}
代码示例来源:origin: salyh/elasticsearch-security-plugin
ctx.setRealm(realm );
内容来源于网络,如有侵权,请联系作者删除!