【发布时间】:2011-11-19 14:38:29
【问题描述】:
我正在开发 Web 应用程序。我在我的 jsp request.getContextPath() 上调用,但奇怪的是我得到了地址 /streetshop。
然后我将一些路径附加为request.getContextPath() + "abc" 并创建文件夹。
然后它在 D:// 中创建文件夹,而不是我的 webapplication 文件夹。
请告诉我,我想上传一张图片放在我的web-application root/images/images.gif。
【问题讨论】:
-
您可以粘贴用于创建文件夹的代码吗?
-
我用于存储图像的以下代码 ...String imagePath= request.getContextPath()+ System.getProperty("file.separator") + p_form.getCategorySelect() + System.getProperty(" file.separator") + p_form.getSubCatSelect() + System.getProperty("file.separator") + order_id +System.getProperty("file.separator") ;在此之后,我将使用此字符串创建文件并保存。
标签: java jsp jakarta-ee tomcat