如何从应用程序内部访问 JBoss 数据目录?
我想使用简单的上传 servlet 将文件上传到我的 server/default/data 目录,并能够从我的应用程序中访问它们,但我似乎找不到如何访问它。我尝试过,
getServletContext().getRealPath("data");
但这没有帮助。
I would like to upload files to my the server/default/data directory using a simple upload servlet and be able to access them from within my application, but I can't seem to find how to access it. I tried
getServletContext().getRealPath("data");
but that didn't help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要获取绝对路径,只需执行以下操作:
to get the absolute path, just do: