本文整理了Java中org.apache.openejb.jee.WebApp.getId()
方法的一些代码示例,展示了WebApp.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebApp.getId()
方法的具体详情如下:
包路径:org.apache.openejb.jee.WebApp
类名称:WebApp
方法名:getId
暂无
代码示例来源:origin: org.apache.geronimo.modules/geronimo-web-2.5-builder
protected String determineDefaultContextRoot(WebApp webApp, boolean isStandAlone, JarFile moduleFile, String targetPath) {
if (webApp != null && webApp.getId() != null) {
return webApp.getId();
}
if (isStandAlone) {
// default configId is based on the moduleFile name
return "/" + trimPath(new File(moduleFile.getName()).getName());
}
// default configId is based on the module uri from the application.xml
return trimPath(targetPath);
}
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
public WebModule(WebApp webApp, String contextRoot, ClassLoader classLoader, String jarLocation, String moduleId) {
this.webApp = webApp;
if (contextRoot == null) {
contextRoot = jarLocation.substring(jarLocation.lastIndexOf(System.getProperty("file.separator")));
if (contextRoot.endsWith(".unpacked")) {
contextRoot = contextRoot.substring(0, contextRoot.length() - ".unpacked".length());
}
if (contextRoot.endsWith(".war")) {
contextRoot = contextRoot.substring(0, contextRoot.length() - ".war".length());
}
}
if (contextRoot.startsWith("/")) contextRoot = contextRoot.substring(1);
this.contextRoot = contextRoot;
this.classLoader = classLoader;
this.jarLocation = jarLocation;
if (webApp != null) webApp.setContextRoot(contextRoot);
if (moduleId == null){
if (webApp != null && webApp.getId() != null){
moduleId = webApp.getId();
} else {
File file = new File(jarLocation);
moduleId = file.getName();
if (moduleId.endsWith(".unpacked")) {
moduleId = moduleId.substring(0, moduleId.length() - ".unpacked".length());
}
}
}
this.moduleId = moduleId;
validation = new ValidationContext(WebModule.class, jarLocation);
}
代码示例来源:origin: com.tomitribe.tribestream/tribestream-container
public void setDefaultMapping(@Observes final BeforeAppInfoBuilderEvent event) {
final AppModule module = event.getAppModule();
if (module == null) {
return;
}
final List<WebModule> webModules = module.getWebModules();
final String ignore = SystemInstance.get().getProperty(DEFAULT_RS_APPLICATION_IGNORE.replace("com.tomi", ""),
System.getProperty(DEFAULT_RS_APPLICATION_IGNORE, module.getProperties().getProperty(DEFAULT_RS_APPLICATION_IGNORE)));
final String mapping = System.getProperty(DEFAULT_RS_APPLICATION_MAPPING, "/api/*");
if (!Boolean.parseBoolean(ignore) && !webModules.isEmpty() /*for tests mainly*/ && !isOAuth2(module)) {
for (final WebModule webModule : webModules) {
final WebApp webApp = webModule.getWebApp();
if (webApp == null) continue; // can't happen
if (!webModule.getRestApplications().isEmpty()) continue; // already a REST application
if ("tomitribe-monitor-internal".equals(webModule.getModuleId())) continue; // monitoring internal webapp
if ("tomitribe-monitor-internal".equals(webApp.getId())) continue; // monitor process
LOGGER.info(WadlxCodes.APPLICATION_CONFIGURER, "No REST application defined for application: {0}. Automatically adding a default JAX RS mapping for it on {1}/{2}. "
+ "Add a class annotated with @javax.ws.rs.ApplicationPath to the application to specify this mapping manually.",
webModule.getModuleId(),
webModule.getContextRoot(),
mapping.replaceAll("^/+", "")); // strip off leading / characters
webApp
.addServlet(InternalApplication.class.getName(), null,
SystemInstance.get().getProperty(
DEFAULT_RS_APPLICATION_IGNORE.replace("com.tomi", ""), mapping));
}
}
}
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
if (contextRoot == null && webApp != null && webApp.getId() != null) {
moduleName = webApp.getId();
内容来源于网络,如有侵权,请联系作者删除!