【问题标题】:How to get access to the static file out of webapp(somehow the web application directory)?如何从 webapp 访问静态文件(不知何故是 web 应用程序目录)?
【发布时间】:2017-09-02 14:22:18
【问题描述】:

我试过这个Simplest way to serve static data from outside the application server in a Java web application。我将此添加到我的 server.xml(D:\apache-tomcat-9.0.0.M22\conf)<Host> 标记内。但它不起作用。

<Context docBase="C:\java workspace\picture" path="/images" />

我想是不是因为我使用了 Intellij 的想法?因为这个想法会在C:\Users\lxa\.IntelliJIdea2017.2\system\tomcat\_drill_3\conf 创建一个新的tomcat 实例?我无法更改C:\Users\lxa\.IntelliJIdea2017.2\system\tomcat\_drill_3\conf的web.xml

【问题讨论】:

    标签: java tomcat jakarta-ee intellij-idea


    【解决方案1】:

    FromRun/Debug Configurations 选择Startup/Connection 然后检查Pass environment variables 并添加一个新条目:CATALINA_BASE 和您的Tomcat 地址

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-08
      • 1970-01-01
      • 1970-01-01
      • 2017-08-31
      • 1970-01-01
      • 2012-03-07
      • 2011-01-21
      相关资源
      最近更新 更多