创建并访问 Apache Tomcat webapps 文件夹之外的文件夹
我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在系统上的某个位置创建一个文件夹并将该文件夹添加到类路径中。这可能会解决您的问题。您必须在运行时存储和检索此文件夹。
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.