【问题标题】:java.io.FileNotFoundException: null\gallery2.jpg (The system cannot find the path specified)java.io.FileNotFoundException: null\gallery2.jpg(系统找不到指定的路径)
【发布时间】:2019-10-15 19:31:16
【问题描述】:

java.io.IOException:处理JSP页面发生异常 /upimg.jsp 第 43 行

String s23=f1.getString();

 String fpath=request.getRealPath("files")+"\\"+filename;
 43:               f1.write(new File(fpath));

【问题讨论】:

  • 您的问题是什么?错误信息很清楚:request.getRealPath("files") 返回null 并且名为null 的文件夹不存在。
  • 我已经在构建文件中创建了一个包含名称文件和文件的文件夹。但是它不起作用

标签: java jsp


【解决方案1】:

您遇到了FileNotFoundException,这意味着您搜索的文件在您声明的路径中不存在。检查您是否给出了正确的路径。如果您确定路径,请确保您搜索的文件在该路径中可用。

【讨论】:

    猜你喜欢
    • 2012-05-28
    • 2014-01-11
    • 1970-01-01
    • 2014-12-19
    • 1970-01-01
    • 2013-11-24
    • 1970-01-01
    • 1970-01-01
    • 2017-11-21
    相关资源
    最近更新 更多