创建并访问 Apache Tomcat webapps 文件夹之外的文件夹

发布于 2024-09-02 02:21:44 字数 264 浏览 2 评论 0原文

我的 Web 应用程序需要最终用户可以上传内容的功能,这些内容稍后可以由其他人下载或查看,当前方案的问题是如果我在 webapps 下创建这样的文件夹作为 Web 项目的一部分,则每次部署您的 Web 应用程序时(*.war),该目录的内容将丢失(或覆盖)。

我认为实现这一目标的最佳方法是在标准 tomcat webapps 之外创建文件夹并从那里访问它,但不知道该怎么做。请指出正确的方向。

我正在使用 Tomcat 4.x,很快就会升级到 6.x。

-SPD

My web application requires functionality where end users can upload content, that can be later downloaded or viewed by others, the problem with current scheme is If I create such folder as part of your web project under webapps, every time I do deploy your web application (*.war), the content of that directory will be lost (or overridden).

I think the best way to accomplish that is to create folder outside of standard tomcat webapps and access it from there, not sure how to do. Please point in correct direction.

I am using Tomcat 4.x soon will be moving to 6.x.

-SPD

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烛影斜 2024-09-09 02:21:44

在系统上的某个位置创建一个文件夹并将该文件夹添加到类路径中。这可能会解决您的问题。您必须在运行时存储和检索此文件夹。

create a folder in some location on your system and add that folder to your classpath. This may solve your problem. You have to store and retrive from this folder at runtime.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文