Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Warbler中添加META-INF/context.xml_Warbler_Context.xml_Meta Inf - Fatal编程技术网

如何在Warbler中添加META-INF/context.xml

如何在Warbler中添加META-INF/context.xml,warbler,context.xml,meta-inf,Warbler,Context.xml,Meta Inf,如何将META-INF/context.xml添加到war中?我在config/warble.rb中没有找到任何配置条目。您必须自己添加一个。您可以在项目中创建META-INF/context.xml目录和文件,并将META-INF添加到config/warble.rb中的config.dirs,也可以添加“路径图”将context.xml文件重命名为war文件中的META-INF目录 config.pathmaps.application += ["%{context.xml,META-INF

如何将META-INF/context.xml添加到war中?我在config/warble.rb中没有找到任何配置条目。

您必须自己添加一个。您可以在项目中创建
META-INF/context.xml
目录和文件,并将
META-INF
添加到
config/warble.rb
中的
config.dirs
,也可以添加“路径图”将context.xml文件重命名为war文件中的META-INF目录

config.pathmaps.application += ["%{context.xml,META-INF/context.xml}p"]

不幸的是,尼克的方法不起作用。该文件实际上被复制到WEB-INF/META-INF/context.xml

我终于找到了将context.xml复制到META-INF的方法:

  • 在rails应用程序根文件夹下创建META-INF/context.xml
  • 取消注释并更改config/warble.rb中的以下行

    config.public\u html=FileList[“public/***”,“doc/***”,“META-INF/context.xml”]


  • 基本上将META-INF视为公共html,它将被复制到webapps/youapp/META-INF。

    更好的解决方法可能是在
    warble.rb
    文件中使用以下内容

    config.script_files << 'path_to_file/context.xml'
    

    上述方法不起作用。该文件实际上被复制到WEB-INF/META-INF/context.xml。我终于找到了将context.xml复制到META-INF:1的方法。在rails应用程序根文件夹2下创建META-INF/context.xml。取消注释并更改config/warble.rb config.public_html=FileList[“public/***”,“doc/***”,“META-INF/context.xml”]中的以下行基本上将META-INF视为public_html,它将被复制到webapps/youapp/META-INF.FWIW,为使其稍微简单,您只需添加到默认值:
    config.public_html+=FileList[“META-INF/context.xml”]
    您可以单击绿色勾号接受自己的答案。
    # These file will be placed in the META-INF directory of the jar or war that warbler
    # produces. They are primarily used as launchers by the runnable feature.
    attr_accessor :script_files