org.apache.tomcat.util.descriptor.web.WebXml.setAlwaysAddWelcomeFiles()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中org.apache.tomcat.util.descriptor.web.WebXml.setAlwaysAddWelcomeFiles()方法的一些代码示例,展示了WebXml.setAlwaysAddWelcomeFiles()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebXml.setAlwaysAddWelcomeFiles()方法的具体详情如下:
包路径:org.apache.tomcat.util.descriptor.web.WebXml
类名称:WebXml
方法名:setAlwaysAddWelcomeFiles

WebXml.setAlwaysAddWelcomeFiles介绍

[英]When merging from this web.xml, should the welcome files be added to the target web.xml even if it already contains welcome file definitions.
[中]从该网站合并时。xml,如果欢迎文件被添加到目标web。xml,即使它已经包含欢迎使用的文件定义。

代码示例

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

private WebXml getTomcatWebXmlFragment(WebXmlParser webXmlParser) {
  WebXml webXmlTomcatFragment = createWebXml();
  webXmlTomcatFragment.setOverridable(true);
  // Set to distributable else every app will be prevented from being
  // distributable when the Tomcat fragment is merged with the main
  // web.xml
  webXmlTomcatFragment.setDistributable(true);
  // When merging, the default welcome files are only used if the app has
  // not defined any welcomes files.
  webXmlTomcatFragment.setAlwaysAddWelcomeFiles(false);
  WebResource resource = context.getResources().getResource(Constants.TomcatWebXml);
  if (resource.isFile()) {
    try {
      InputSource source = new InputSource(resource.getURL().toURI().toString());
      source.setByteStream(resource.getInputStream());
      if (!webXmlParser.parseWebXml(source, webXmlTomcatFragment, false)) {
        ok = false;
      }
    } catch (URISyntaxException e) {
      log.error(sm.getString("contextConfig.tomcatWebXmlError"), e);
    }
  }
  return webXmlTomcatFragment;
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

private WebXml getTomcatWebXmlFragment(WebXmlParser webXmlParser) {
  WebXml webXmlTomcatFragment = createWebXml();
  webXmlTomcatFragment.setOverridable(true);
  // Set to distributable else every app will be prevented from being
  // distributable when the Tomcat fragment is merged with the main
  // web.xml
  webXmlTomcatFragment.setDistributable(true);
  // When merging, the default welcome files are only used if the app has
  // not defined any welcomes files.
  webXmlTomcatFragment.setAlwaysAddWelcomeFiles(false);
  WebResource resource = context.getResources().getResource(Constants.TomcatWebXml);
  if (resource.isFile()) {
    try {
      InputSource source = new InputSource(resource.getURL().toURI().toString());
      source.setByteStream(resource.getInputStream());
      if (!webXmlParser.parseWebXml(source, webXmlTomcatFragment, false)) {
        ok = false;
      }
    } catch (URISyntaxException e) {
      log.error(sm.getString("contextConfig.tomcatWebXmlError"), e);
    }
  }
  return webXmlTomcatFragment;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

webXmlDefaultFragment.setAlwaysAddWelcomeFiles(false);

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

webXmlDefaultFragment.setAlwaysAddWelcomeFiles(false);

代码示例来源:origin: codefollower/Tomcat-Research

webXmlDefaultFragment.setAlwaysAddWelcomeFiles(false);

相关文章

WebXml类方法